php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53471 accepting self signed certs regarless of Stream Context
Submitted: 2010-12-04 04:05 UTC Modified: 2011-12-07 05:29 UTC
From: f at case dot edu Assigned: frozenfire (profile)
Status: Closed Package: OpenSSL related
PHP Version: 5.3.1RC2 OS: Windows
Private report: No CVE-ID: None
 [2010-12-04 04:05 UTC] f at case dot edu
Description:
------------
self signed certificates seem to be accepted when using the protocol wrappers regardless of the allow_self_signed stream context

the ftp package seems to reject self signed certificates however.

Test script:
---------------
$con=stream_context_create(array('ssl'=>array('allow_self_signed',false)));
var_dump(file_get_contents('ftps://John:pass@selfsigned.example.com/test.php,false,$con'));

$ftp=ftp_ssl_connect('selfsigned.example.com');
ftp_login($ftp,'John','pass');

Expected result:
----------------
file_get_contents and ftp_login should both throw some sort of error to the effect of "SSL/TLS handshake failed"

Actual result:
--------------
file_get_contents retrieves the file with no warnings

ftp_login throws the error "SSL/TLS handshake failed"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-19 01:07 UTC] cataphract@php.net
-Type: Security +Type: Documentation Problem
 [2011-04-19 01:07 UTC] cataphract@php.net
You also need "verify_peer". The manual should be clearer on this.
 [2011-12-07 05:28 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=320557
Log: Clarified that allow_self_signed requires verify_peer to function. Closes bug #53471.
 [2011-12-07 05:29 UTC] frozenfire@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2011-12-07 05:29 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC