使用wss连接之后php报SSL错误

xuan5

/vendor/workerman/workerman/Connection/TcpConnection.php on line 567:

     if ($this->transport === 'ssl' && $this->_sslHandshakeCompleted !== true) {
            $ret = stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv2_SERVER | 
                           STREAM_CRYPTO_METHOD_SSLv23_SERVER);
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408A10B:SSL routines:SSL3_GET_CLIENT_HELLO:wrong version number in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408A10B:SSL routines:SSL3_GET_CLIENT_HELLO:wrong version number in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408A10B:SSL routines:SSL3_GET_CLIENT_HELLO:wrong version number in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
 PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request in /vendor/workerman/workerman/Connection/TcpConnection.php on line 567
6658 1 0
1个回答

walkor

应该是有客户端用明文非ssl连导致的,服务端开启了ssl后客户端应该用ssl连,websocket协议的话就用wss连,http协议的话就用https连。如果还用ws或者http连的话会报这个提示。
 
这个提示并不影响正常的用户,只是告诉开发者有用户仍然以明文连接服务。

  • xuan5 2018-07-04

    所有外部链接都是https或者wss,也开了ssl,php也支持各ssl版本,内部是以websocket://0.0.0.0:8282的形式连接的

  • jinnstyl 2019-07-14

    同样遇到一样的错误

  • walkor 2019-07-14

    有些用户打开的页面是老页面,老页面用的ws连接的,升级wss后老页ws断开后仍然以ws重连就会导致这个提示。
    你们可以把wss端口改成和老端口不一样的,避免老页面以ws连到wss端口。

年代过于久远,无法发表回答
🔝