linux – How to fix cURL error 35 when consulting endpoints in Laravel production server?

I have a Laravel project consulting various endpoints via get method, and sometimes in random moment return this error: production.ERROR: GuzzleHttp\Exception\ConnectException: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to “{service name}”

This only occur in production, in dev server and locally is not doing that. The specificactions of productions server are:

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();

I think maybe an Nginx config or SSL certificate problem on the server, I tried to update the guzzle library and it keeps giving the same error, I also tested on the development server and no error occurred.

Also doing nginx -t result this:
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

I think that SSL certificate is a self-signed, but locally also is a self-signed certificate

Thanks!!

Read more here: Source link