Bug #74598 [Ver->Csd]: unlink ignores stream context

From: Date: Sun, 28 May 2017 04:24:12 +0000
Subject: Bug #74598 [Ver->Csd]: unlink ignores stream context
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209290@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74598&edit=1

 ID:                 74598
 Updated by:         pollita@php.net
 Reported by:        ma at temponizer dot dk
 Summary:            unlink ignores stream context
-Status:             Verified
+Status:             Closed
 Type:               Bug
 Package:            FTP related
 Operating System:   CentOS
 PHP Version:        7.0.19
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of pollita
Revision: http://git.php.net/?p=php-src.git;a=commit;h=05849a242a878d5513e3e3be78a0c89fb9fa342b
Log: Bugfix #74598 ftp:// ignores context


Previous Comments:
------------------------------------------------------------------------
[2017-05-16 07:09:45] requinix@php.net

Indeed, it is ignored.
https://github.com/php/php-src/blob/PHP-7.0.19/ext/standard/ftp_fopen_wrapper.c#L911

Same for rename, mkdir, and rmdir. opendir and stat do use it.

------------------------------------------------------------------------
[2017-05-16 06:57:53] ma at temponizer dot dk

Just tested further and it seems like it ignores the stream context completely.

------------------------------------------------------------------------
[2017-05-15 14:10:40] ma at temponizer dot dk

Description:
------------
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);



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74598&edit=1


Thread (5 messages)

« previous php.bugs (#209290) next »