在AWS弹性豆茎上的laravel中获得安全的网络插座的问题。
他们在超文本传输协议的开发和生产中工作良好
在dev中,它可以在https和wss上正常工作。
在https和wss上的生产(使用所有相同的设置,只是不同的证书)中,我得到以下错误
失败:建立连接时出错:网络::错误\u连接\u已关闭
假设证书或密钥有问题,我尝试更改为错误的证书
失败:连接建立中出错:net::ERR\u SSL\u VERSION\u或\u CIPHER\u不匹配
所以我假设证书不是问题所在。
配置如下:websockets。php
'apps' => [
[
'id' => env('PUSHER_APP_ID'),
'name' => env('APP_NAME'),
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'path' => env('PUSHER_APP_PATH'),
'capacity' => null,
'enable_client_messages' => true,
'enable_statistics' => true,
],
],
'ssl' => [
/*
* Path to local certificate file on filesystem. It must be a PEM encoded file which
* contains your certificate and private key. It can optionally contain the
* certificate chain of issuers. The private key also may be contained
* in a separate file specified by local_pk.
*/
'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
/*
* Path to local private key file on filesystem in case of separate files for
* certificate (local_cert) and private key.
*/
'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
/*
* Passphrase for your local_cert file.
*/
'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
'verify_peer' => false,
],
. env文件
LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=/etc/pki/tls/certs/cert.cer
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=/etc/pki/tls/certs/server.key
请将密码短语添加到您的证书文件和env('LARAVEL\u WEBSOCKETS\u SSL\u Passphrase',null)。
我对没有密码的密钥库也有同样的问题。