Skip to content

Commit e69fc0a

Browse files
authored
support SSLv2 SSLv3 crypto method
1 parent 8b60aee commit e69fc0a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Connection/TcpConnection.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,11 @@ public function baseRead($socket, $check_eof = true)
387387
{
388388
// SSL handshake.
389389
if ($this->transport === 'ssl' && $this->_sslHandshakeCompleted !== true) {
390-
$ret = stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER);
390+
$ret = stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv2_SERVER |
391+
STREAM_CRYPTO_METHOD_SSLv3_SERVER | STREAM_CRYPTO_METHOD_SSLv23_SERVER);
391392
// Negotiation has failed.
392393
if(false === $ret) {
393-
$error = error_get_last();
394-
$error_msg = '';
395-
if ($error) {
396-
$error_msg = "{$error['message']} in {$error['file']} on line {$error['line']}";
397-
}
398-
echo new \Exception("SSL handshake fail $error_msg");
394+
echo "\nSSL Handshake fail. \nBuffer:".bin2hex(fread($socket, 8182))."\n";
399395
return $this->destroy();
400396
} elseif(0 === $ret) {
401397
// There isn't enough data and should try again.

0 commit comments

Comments
 (0)