Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music

All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => Loadtest gatling.io knowledge => Topic started by: golfreeze on เมษายน 05, 2016, 12:27:39 PM

Title: connect via ssl certificate with gatling.io and php
Post by: golfreeze on เมษายน 05, 2016, 12:27:39 PM
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url_ktb);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $input_xml);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

//Connected for SSL
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/CAcerts/cert.crt");

//if your website and cert will be http://www.packetlove.com/CAcerts/cert.crt (http://www.packetlove.com/CAcerts/cert.crt)
Title: Re: connect via ssl certificate with gatling.io and php
Post by: golfreeze on เมษายน 05, 2016, 12:28:13 PM
##Reference site
https://curl.haxx.se/docs/sslcerts.html (https://curl.haxx.se/docs/sslcerts.html)
http://php.net/manual/en/function.curl-setopt.php (http://php.net/manual/en/function.curl-setopt.php)