Mandrill PHP unable to get local issuer SSL certificate -



Mandrill PHP unable to get local issuer SSL certificate -

i've installed mandrill php api on windows apache server. when trying send email using code below error:

mandrill_httperror - api phone call messages/send-template failed: ssl certificate problem: unable local issuer certificate

it's not clear me how mandrill connects local issuer certificate. web server have valid certificate , can display https pages successfully.

any ideas?

$mandrill = new mandrill('mymandrillapikey'); $message = array( 'subject' => 'test message', 'from_email' => 'myemailaddress', 'html' => '<p>this test message mandrill\'s php wrapper!.</p>', 'to' => array(array('email' => 'myemailaddress', 'name' => 'david splat')), 'merge_vars' => array(array( 'rcpt' => 'myemailaddress', 'vars' => array( array( 'name' => 'firstname', 'content' => $fname), array( 'name' => 'lastname', 'content' => $lname) )))); $template_name = 'mytemplatename'; $template_content = array( array( 'name' => 'main', 'content' => 'hi *|firstname|* *|lastname|*, signing up.'), array( 'name' => 'footer', 'content' => 'copyright 2014.') ); print_r($mandrill->messages->sendtemplate($template_name, $template_content, $message)); } catch(mandrill_error $e) { // mandrill errors thrown exceptions echo 'a mandrill error occurred: ' . get_class($e) . ' - ' . $e->getmessage(); throw $e; }

you don't need turn off curl ssl option, instead can download cacert.pem file http://curl.haxx.se/docs/caextract.html , include in either php.ini file curl.cainfo="/exact/location/to/cacert.pem"

or alter lines in mandrill.php file utilize below.

curl_setopt ($this->ch, curlopt_ssl_verifypeer, true); curl_setopt ($this->ch, curlopt_cainfo, __dir__ . "/cacert.pem")

link post http://tutewall.com/ssl-certificate-problem-unable-to-get-local-issuer-certificate/

php mandrill

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -