在生產伺服器中諮詢端點時如何修復 cURL 錯誤 35?

在生產伺服器中諮詢端點時如何修復 cURL 錯誤 35?

我有一個 Laravel 專案透過 get 方法諮詢各個端點,有時會隨機傳回此錯誤:

production.ERROR: GuzzleHttp\Exception\ConnectException: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to "{service name}"

這只會發生在生產環境中,在開發伺服器中,而在本地則不會這樣做。生產伺服器的具體操作是:

MariaDB 10.5.15 Ubuntu 21.10 Laravel version 8.54 Library Guzzle 7.0.1 Nginx 1.18.0 The consult look like this: $response = Http::withHeaders($this->headers)->get($query); $response->throw();

我認為可能是伺服器上的 Nginx 配置或 SSL 憑證問題,我嘗試更新 guzzle 庫,但它一直給出相同的錯誤,我還在開發伺服器上進行了測試,沒有發生錯誤。

還做nginx -t這樣的結果:

nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/etc/ssl/certs/ssl-cert-snakeoil.pem" nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful

我認為SSL憑證是自簽署的,但在本地也是自簽署的憑證。

謝謝!

相關內容