There are 2 servers - remote and our (client). Connect to a remote server via CURL (with SSL). There is a client certificate ( .crt and .key ).
Through openSSL with the indication of certificates, the connection goes ( openssl s_client -debug -connect xxx.xxx.xxx.xxx -CAfile cafile.crt -cert cert_file.crt -key key_file.key ) when attempting to access through curl returns null .
In apache, the SSLCertificateFile and SSLCertificateKeyFile parameters SSLCertificateFile SSLCertificateKeyFile with references to the certificate and key in ssl.conf.
Configured virtual host <VirtualHost *:443> in httpd.conf. The result of these manipulations was not given - in any case, null is returned.
How can I set up an ssl connection via curl to a remote server?
Request curl parameters
$ ch = curl_init ();
curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt ($ ch, CURLOPT_SSLCERT, $ cert_path);
curl_setopt ($ ch, CURLOPT_SSLKEY, $ key_path);
curl_setopt ($ ch, CURLOPT_CAINFO, $ CAfile);
curl_setopt ($ ch, CURLOPT_CERTINFO, true);