I am trying to contact a url via php's stream_socket_client() command which is failing with no error code or msg. Does this use openssl, curl or something else? The site uses https and works fine from a web browser.

enter image description here

When I call openssl directly it connects but appears unahppy with my certificate chain.

root@drupal7 drupal7/includes# openssl s_client -connect test.cgps.org:443
Verify return code: 21 (unable to verify the first certificate)

Same with curl

curl https://test.cgps.org/?q=/admin/config/search/clean-urls/check
curl: (60) SSL certificate problem: unable to get local issuer certificate

So I figured I needed to install the intermediate cert into Linux which I did by placing the same intermediate cert Apache uses into /usr/local/share/ca-certificates and running update-ca-certificates.

root@drupal7 drupal7/includes# update-ca-certificates
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.

Still no luck...

  • Do you control the server? if so you should include the intermediate cert in the servers configuration (usually by appending it to the certificate file). – Peter Green Oct 19 '15 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.