Paypal IPN- error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

wish18
Contributor
Contributor

Hi,

I got an email about the Paypal 2016 Merchant security upgrade, for these changes:

- SSL Certificate Upgrade to SHA-256
- TLS 1.2 and HTTP/1.1 Upgrade

 

Currently testing it on the Paypal Sandbox, but getting the message "error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure" when using this IPN test plugin, and this php file for testing.

 

I can see in my sandbox account, in the IPN history that the transaction was successful, but it seems that it is not connecting to my Paypal IPN (ipn.php). I used the code below, and it is not working. (was working before the upgrade, but then I looked at the IPN: Getting Started and change the code around). No messages are sent to my email (below I have removed my email).

 

 

<?php

header('HTTP/1.1 200 OK');

$firstName 		= $_POST['first_name'];
$lastName 		= $_POST['last_name'];
$payerEmail 	= $_POST['payer_email'];
$addressStreet 	= $_POST['address_street'];
$addressZip 	= $_POST['address_zip'];
$addressCity 	= $_POST['address_city'];
$txnID 			= $_POST['txn_id'];
$donateAmount		= $_POST['mc_gross'];
$recipient_fullname = $_POST['custom'];
$recipient_email 	= $_POST['option_name2'];


$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
	$value = urlencode(stripslashes($value));
	$req .= "&$key=$value";
}

// Set up the acknowledgement request headers
$header  = "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";             
$header .= "Host: www.sandbox.paypal.com\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";


// Open a socket for the acknowledgement request
//$fp = fsockopen('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
//$fp = fsockopen('tls://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
$fp = fsockopen('www.sandbox.paypal.com', 443, $errno, $errstr, 30);


if(!$fp){
	//Can not connect to PayPal to validate IPN message
}
else{

	fputs($fp, $header . $req);
	
	while(!feof($fp)) { 
	
		$res = fgets($fp, 1024); 
		
		file_put_contents('result.txt', var_export($_POST, true));
	
		
		if (strcmp ($res, "VERIFIED") == 0) { 
			 $mail_From = "... ";
                        $mail_To = "..."; 
$mail_Subject = "VERIFIED IPN";
 $mail_Body = $req;
 mail($mail_To, $mail_Subject, $mail_Body, $mail_From);
			
		} else if (strcmp ($res, "INVALID") == 0) { 
			$mail_From    = "... ";
 $mail_To      = "...";
 $mail_Subject = "INVALID IPN";
 $mail_Body    = $req;

 mail($mail_To, $mail_Subject, $mail_Body, $mail_From);

		}		
	}
	fclose ($fp);
}
?>

 

I am using goDaddy as the web host:

 

Current details:

PHP version- PHP 5.2

.NET Runtime Version - ASP.NET 2.0/3.0/3.5

SSL Certificate - Not Purchased

 

What should I do to fix this problem?

 

In goDaddy, I do have the option to upgrade the .NET Runtime to "ASP.NET 4.0/4.5", and PHP to "PHP 5.4", will that help fix the issue?

Thank you

 

Login to Me Too
1 REPLY 1

wish18
Contributor
Contributor

Is there any way to fix this error? And do you have to upgrade your paypal merchant security????

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.