0

I am losing all my hair since a couple of days with the Paypal Sandbox. My IPN does not work anymore. I can't have SSL connection with fsockopen() or Curl. I've try with different accounts and different hosts. Nothing.

$host = 'www.sandbox.paypal.com';
if(function_exists('openssl_open')) {
    $fp = fsockopen('ssl://'.$host,443,$errno,$errstr,30);
    if($fp) {
        echo "success : ";
        var_dump($fp);
    }
    else echo "echec : ".$errno." | ".$errstr;
fclose($fp);
}

This short code return echec : 0 |

The response is the same with www.paypal.com

Curiously, with www.google.com, I have : success : resource(2) of type (stream)

I'm on a PHP 7 which should normally have the latest release (g5, SHA256 ...) requested by Paypal. Is there a way to make this connection with Paypal ?

Update : I have check the SHA on https://www.sha2sslchecker.com/. I'm hosted by OVH on a shared plan. Only SHA1 is available. Paypal required now SHA2. That's it.

Jacques
  • 38
  • 7

1 Answers1

1

It is because OVH openssl version 0.9.8 used by CURL in PHP 7 legacy. Change to PHP 7 Estable and cgi (this update openssl library version to 1.0.1t required by paypal)

I use this ipn validator and working without issues: https://github.com/paypal/ipn-code-samples

Reading and checking PHP requisites: https://github.com/paypal/tls-update ...PHP uses the system supplied curl library. The curl library requires OpenSSL 1.0.1c or higher. You may also need to update your SSL/TLS libraries...