
get メソッドを介してさまざまなエンドポイントを参照する Laravel プロジェクトがあり、ランダムな瞬間に次のエラーが返されることがあります。
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 証明書は自己署名だと思いますが、ローカルでも自己署名証明書です。
ありがとう!