cakephp/cakephp — pull request #3295 by MelvinRoss (2014-04-11 16:26:53+00:00)
Title: Handle situation where PHP can';t figure out what version of SSL to use when creating a socket.

According to the PHP documentation, PHP is suppose to be able to figure out which version of the SSL standard to use if you create a socket with "ssl://". I recently discovered that this doesn't always work and it fails to create the socket, even though the website being accessed is fully functional and accessible through other means, such as a web browser.

Currently, HttpSocket uses the "ssl://" prefix, and when it runs into the aforementioned situation, it fails to return a result to the user and says there is a problem establishing the encrypted connection. This obviously would cause confusion, since the user is likely to then check the URL with a browser and see that it's working jut fine. Luckily this error is handleable, by simply specifying which version of SSL should be used.

While I'm not sure if the root of this bug is a server configuration issue, PHP issue, etc. I do know that browsers handling it just fine, and I see no reason why Cake shouldn't handle it too.

There are two proposed solutions in this pull request as you can see. The do while solution currently can't pass a Travis build because there is no guarantee that PHP has sslv2 support compiled in. I can submit another pull request for the Test Case to accommodate that situation if it's decided to go with the do while.