cURL SSL Certificate working on Linux but not on Windows

4

I am using cURL to do a GET Request to a URL using HTTPS protocol. I retrieved the CA Cert file from the owners of the webservice. The .crt file works in RHEL5 but not in windows, using the same command. Below are the commands I am using:

RHEL5 without specifying --cacert

bash-3.2$ curl -i "https://<url>"
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
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). The default
 bundle is named curl-ca-bundle.crt; 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.

RHEL5 with specifying --cacert

bash-3.2$ curl -i "https://<url>" --cacert ca-bundle.crt 
HTTP/1.1 200 OK
Transfer-encoding: chunked
Cache-control: no-cache
Content-type: text/html
Pragma: no-cache
Date: Thu, 02 Jun 2016 03:06:32 GMT

<data>

Windows without specifying --cacert

curl -i "https://<url>"
curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT
 (0x80090325) - The certificate chain was issued by an authority that is not trusted.

Windows with specifying --cacert

curl -i "https://<url>" --cacert C:\<path>\ca-bundle.crt
curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT
 (0x80090325) - The certificate chain was issued by an authority that is not trusted.

I am using exactly the same .crt file. Any suggestions on what might be the issue?

linux
ssl
curl
ssl-certificate
asked on Stack Overflow Jun 2, 2016 by iiSGii • edited Jun 3, 2016 by Daniel Stenberg

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0