I am getting this
Curl error: OpenSSL SSL_connect: Connection reset by peer in connection to api.mailjet.com:443
error on my server, i contacted mailjet and also my server provider, each of them saying all is good from their side.
Mailjet says IP is not blocked, and Server company says we are not putting any restrictions. if i change the maiiljet link with any other company in the code below it works, and the Mailjet link work on other server.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.mailjet.com/v3.1/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $details);
curl_setopt($ch, CURLOPT_USERPWD, $k1 . ':' . $k2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
print_r($result);
if(curl_errno($ch)){
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
Any ideas would help, Thank you so much.
i tried with and without
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);