CentOS PHP curl unable to negotiate an acceptable set of security parameters -


on ubuntu 14.04.3 code works fine:

$url_login = "https://test.example.com/login.do";  $cert_file = '/var/www/html/test/cert.pem'; $ssl_key = '/var/www/html/test/cert_private.pem';  $post_fields = 'useraction=1&cancelreason=&canceltype=&account=&memotype=&usertext=&userid=99999999&password=xxxxxxxxxxxxxxxx';  $ch = curl_init();  $options = array(      curlopt_returntransfer => 1,     curlopt_header         => 1,     curlopt_followlocation => 1,     curlopt_ssl_verifyhost => 0,     curlopt_ssl_verifypeer => 0,      curlopt_useragent => 'mozilla/4.0 (compatible; msie 5.01; windows nt 5.0)',     curlopt_verbose        => 0,     curlopt_url => $url_login ,      curlopt_sslcert => $cert_file ,     curlopt_sslcerttype, 'pem',     curlopt_sslkey => $ssl_key,      curlopt_cookiesession => 1,      curlopt_post => true,     curlopt_postfields => $post_fields );  curl_setopt_array($ch , $options);  $output = curl_exec($ch); 

the php on ubuntu using curl openssl.

on centos 7 if fails with:

curl error : ssl peer unable negotiate acceptable set of security parameters. 

curl here nss.

the "cert.pem" contains client certificate cert-chain, , "cert_private.pem" contains private key not password protected. (-----begin rsa private key-----).

how can above php code work both? openssl , nss implementations of curl?

how correcting:

curlopt_sslcerttype, 'pem', 

to

curlopt_sslcerttype => 'pem', 

?


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -