0

I have installed the SSL certificates on my site and it is working in chrome and also in firefox. But whenever I perform curl with my site url, I am getting the below error.

* Connected to www.example.org port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 597 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
* Closing connection 0
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

I have seen many questions related to this and have tried them. I have tried updating the ca-certificates in my local and the error changed from local issuer verification to what it is now.

Can anyone suggest me where I am going worng?

1 Answer 1

2

Since you don't provide the URL to replicate the problem I can only speculate what the reason might be. But chances are high that your server is misconfigured and does not sent the required chain (intermediate) certificates, i.e. some chain certificate is missing. Desktop browsers often work around this issue but other clients will usually fail.

To verify my speculation check your site against SSLLabs and look out for reported chain issues.

Update: according to the comments of the OP at this question I was right. SSLLabs complained about "This server's certificate chain is incomplete" and also set the grade to B because of this.

Sign up to request clarification or add additional context in comments.

6 Comments

Yes, I can understand, but I can't disclose much sorry. I tried the SSLLabs and everything seemed to work and they gave B grade. Only thing I got is that they said some error about some certificate chain file."This server's certificate chain is incomplete ". Can you help me with this
@Bej: this is exactly what I've said - chain issues. Your are missing an intermediate certificate. SSLLabs even says which intermediate certificate is missing. But given that I don't know your server setup nor what exactly is missing I cannot help you with details how to fix it.
The missing chain file was the problem. I created a new .pem file and updated the SSL configuration with that and it worked like a charm. Please update the answer so that I can accept it as the answer.
@Bej: I'm not sure what I should really update in the answer - except that I was right with my speculation.
add the missing chain file thing. I just don't want anyone to downvote the accepted answer.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.