Having a strange issue with cURL and PHP on a couple of CentOS boxes.
Locally, I'm running CentOS 6.3. Remote is CentOS 5.9
Locally, the box receives a request, scp's a file to the remote server, then performs a cURL request via PHP to the remote server to send some info. The request always fails on the first attempt of the day. Subsequent requests work fine. Remote has a valid SSL cert -- even so, turning off cert and host verification does not fix the problem.
The logging has not been very helpful. Turning verbosity up to 11, the most meaningful entries are as such:
* About to connect() to www.example.com port 443 (#0)
* Trying 203.0.113.10... * connected
* Connected to www.example.com (203.0.113.10) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* NSS error -5938
* Closing connection #0
* SSL connect error
Googling the error doesn't help much either. Looks like twitter was having a similar problem (https://dev.twitter.com/discussions/1549) which they apparently fixed, but didn't elaborate on how it got fixed.
Any ideas on where to look/what to do to mitigate the problem would be appreciated.
it's general problem for curl compiled with NSS (only redhat-linuxes, debian and suse curl packages compiled without nss). you need compile curl from sources without nss-library.
so, i haven't solution how https-connections worked with nss-curl.
I encountered a similar "NSS error -5938" when using an outdated CentOS 6.x system to connect to an embedded device that stopped accepting TLS 1.0, only allowing TLS 1.1 and higher. The solution for me was to do a
yum update
. I saw these updates occurred:I think this might be the specific change that helped:
The NSS error 5938 message usually means the server killed your connection. You should check the server side logs of curl's target to see why your connection was killed.
It might be something as simple as "could not get a reverse dns hostname for X".