|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74598 unlink ignores stream context
Submitted: 2017-05-15 14:10 UTC Modified: 2017-05-28 04:26 UTC
From: ma at temponizer dot dk Assigned: pollita (profile)
Status: Closed Package: FTP related
PHP Version: 7.0.19 OS: CentOS
Private report: No CVE-ID: None
 [2017-05-15 14:10 UTC] ma at temponizer dot dk
When using unlink for a FTPS filename with a stream context where verify_peer is set to false, it still tries to verify the certificate.

This results in two warnings
- "SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed"
- "Unable to connect to ftps://servername/path"

Test script:
$sslContext = stream_context_create(['ssl' => [
  'verify_peer' => false,
  'verify_peer_name' => false

unlink('ftps://servername/path', $sslContext);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-16 06:57 UTC] ma at temponizer dot dk
-Summary: unlink ignores verify_peer +Summary: unlink ignores stream context
 [2017-05-16 06:57 UTC] ma at temponizer dot dk
Just tested further and it seems like it ignores the stream context completely.
 [2017-05-16 07:09 UTC]
-Status: Open +Status: Verified -Package: Filesystem function related +Package: FTP related
 [2017-05-16 07:09 UTC]
Indeed, it is ignored.

Same for rename, mkdir, and rmdir. opendir and stat do use it.
 [2017-05-28 04:24 UTC]
Automatic comment on behalf of pollita
Log: Bugfix #74598 ftp:// ignores context
 [2017-05-28 04:24 UTC]
-Status: Verified +Status: Closed
 [2017-05-28 04:26 UTC]
-Assigned To: +Assigned To: pollita
 [2017-05-28 04:26 UTC]
Fixed for PHP 7.0.21, 7.1.7, and 7.2.0 by
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 28 22:01:24 2023 UTC