gateway worker 创建wss服务后,时不时命令窗口会打印错误,也定位不到问题,真的快愁死了,求大神解答疑惑

evo

SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1417D18C:SSL routines:tls_process_client_hello:version too low
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1417D18C:SSL routines:tls_process_client_hello:version too low
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09B:SSL routines:ssl3_get_record:https proxy request
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1417D18C:SSL routines:tls_process_client_hello:version too low
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL_R_NO_SHARED_CIPHER: no s
uitable shared cipher could be used. This could be because the server is missin
g an SSL certificate (local_cert context option)
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
frame not masked so close the connection
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1417D18C:SSL routines:tls_process_client_hello:version too low
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
SSL handshake error: stream_socket_enable_crypto(): SSL: ²Ù×÷³É¹¦Íê³É¡£

frame not masked so close the connection
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with co
de 1. OpenSSL Error messages:
error:1408F09C:SSL routines:ssl3_get_record:http request
frame not masked so close the connection

以下为start_gateway.php代码

<?php 
/**
 * This file is part of workerman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link http://www.workerman.net/
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
 */
use \Workerman\Worker;
use \Workerman\WebServer;
use \GatewayWorker\Gateway;
use \GatewayWorker\BusinessWorker;
use \Workerman\Autoloader;

// 自动加载类
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/defined.php';
// gateway 进程,这里使用Text协议,可以用telnet测试

$context = array(
    'ssl' => array(
        // 请使用绝对路径
        'local_cert'                 => 'D:\websocket\ws.pem',
        'local_pk'                   => 'D:\websocket\ws.key',
        'verify_peer'               => false,
    )
);
// websocket协议(端口任意,只要没有被其它程序占用就行)

$gateway = new Gateway(GATEWAYADDRESS,$context);
// 开启SSL,websocket+SSL 即wss
$gateway->transport = 'ssl';

// gateway名称,status方便查看
$gateway->name = 'YourAppGateway';
// gateway进程数
$gateway->count = 4;
// 本机ip,分布式部署时使用内网ip
$gateway->lanIp = INTRANETIP;
// 内部通讯起始端口,假如$gateway->count=4,起始端口为4000
// 则一般会使用4000 4001 4002 4003 4个端口作为内部通讯端口
$gateway->startPort = 2900;
// 服务注册地址
$gateway->registerAddress = REGISTERADDRESS;

// 如果不是在根目录启动,则运行runAll方法
if(!defined('GLOBAL_START'))
{
    Worker::runAll();
}
5099 1 0
1个回答

xiuwang

D:websocket\ws.pem
D:websocket\ws.key

你确认磁盘路径是这样的?

  • evo 2020-04-28

    D:\websocket\ws.pem
    D:\websocket\ws.key
    上传问题的时候删了一下下证书路径,多删了一个反斜杠,改回来了,不影响问题本质。。。

  • xiuwang 2020-04-28

    确认下路径对不对吧,看报错像是路径问题。是在不行就nginx代理喽

  • evo 2020-05-06

    @1459:应该不是路径问题,如果是路径问题的话,应该就直接不能正常使用,但偏偏用wss还能正常使用,就是时不时的给蹦出来这个一个错误,很烦人,几天下来,一列错误,看着难受

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