curl https://discourse.domain.com/site.json -v
* Hostname was NOT found in DNS cache
* Trying 10.0.0.X...
* Connected to discourse.domain.com (10.0.0.X) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):
curl: (60) SSL certificate problem: unable to get local issuer certificate
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.
If I do
curl https://discourse.domain.com/site.json -v --cacert /etc/ssl/certs/cacert.pem
Then it works after adding the CA bundle for my cert to the end of the cacert file. I’m not sure why it doesn’t work without the --cacert flag because
CApath: /etc/ssl/certs should parse the cacert.pem file that’s in that path, no?
I can curl https://google.com without specifying a cacert so I know it’s reading some authorities without problems.
I also added
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = /etc/ssl/certs/cacert.pem
to the apache php.ini file and restarted apache. Still not working in wordpress.