【问题标题】:Laravel Echo Server and net::ERR_SSL_PROTOCOL_ERROR on https versionLaravel Echo 服务器和 net::ERR_SSL_PROTOCOL_ERROR 在 https 版本上
【发布时间】:2020-12-28 19:15:14
【问题描述】:

我在我的 nginx 服务器上使用 laravel 5.8 和 laravel echo 服务器、socket.io 和 redis。

我的网站一直工作到昨天没有错误,但今天它一直给我套接字错误,例如:

GET https://example.com:6001/socket.io/?EIO=3&transport=polling&t=NHtNFvZ net::ERR_SSL_PROTOCOL_ERROR

这是我的 laravel-echo-server.json 文件:

{
    "authHost": "http://localhost:8000",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "123",
            "key": "123"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {
            "port": "6379",
            "host": "127.0.0.1"
        },
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {},
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "http://localhost:80",
        "allowMethods": "GET, POST",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
}

首先我遇到了ERR_CRT_DATE_INVALID 错误,但后来遇到了ERR_SSL_PROTOCOL_ERROR

我已经使用 sudo supervisorctl restart echo-server:* 重新启动了 echo worker,但仍然是同样的问题。

【问题讨论】:

    标签: php laravel nginx redis socket.io


    【解决方案1】:

    我终于解决了这个问题。

    我补充说:

    "authHost": "https://localhost:8000",

    "protocol": "https",

    "sslCertPath": "/etc/letsencrypt/live/example.com/fullchain.pem",

    "sslKeyPath": "/etc/letsencrypt/live/example.com/privkey.pem",

    在我的 laravel-echo-server.json 文件中并使用 sudo supervisorctl restart echo-server:* 重新启动 echo 服务器工作进程

    它可能会在将来帮助某人。

    【讨论】:

      猜你喜欢
      • 2017-01-11
      • 1970-01-01
      • 2017-06-13
      • 2019-02-08
      • 1970-01-01
      • 2020-07-03
      • 2018-08-17
      • 2023-03-06
      • 1970-01-01
      相关资源
      最近更新 更多