Kaynağa Gözat

support SSLv2 SSLv3 crypto method

walkor 8 yıl önce
ebeveyn
işleme
e69fc0a5b3
1 değiştirilmiş dosya ile 3 ekleme ve 7 silme
  1. 3 7
      Connection/TcpConnection.php

+ 3 - 7
Connection/TcpConnection.php

@@ -387,15 +387,11 @@ class TcpConnection extends ConnectionInterface
     {
         // SSL handshake.
         if ($this->transport === 'ssl' && $this->_sslHandshakeCompleted !== true) {
-            $ret = stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER);
+            $ret = stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv2_SERVER |
+                STREAM_CRYPTO_METHOD_SSLv3_SERVER | STREAM_CRYPTO_METHOD_SSLv23_SERVER);
             // Negotiation has failed.
             if(false === $ret) {
-                $error = error_get_last();
-                $error_msg = '';
-                if ($error) {
-                    $error_msg = "{$error['message']} in {$error['file']} on line {$error['line']}";
-                }
-                echo new \Exception("SSL handshake fail $error_msg");
+                echo "\nSSL Handshake fail. \nBuffer:".bin2hex(fread($socket, 8182))."\n";
                 return $this->destroy();
             } elseif(0 === $ret) {
                 // There isn't enough data and should try again.