Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic


TLS 1.2 and HTTP/1.1 upgrade (PHP fsockopen)



I am new to PHP & PayPal and trying to figure it out whether I need to upgrade TLS or not according to the following PayPal article:


I tried testing the system using "" and "" endpoints.


When I tested using "" endpoint, I've got the message below right away, followed by "PayPal_Connection_OK" after 6-8 minutes.


HTTP/1.1  200 OKContent-Type: text/htmlContent-Length: 20
Connection: keep-alive

When I tested using "" endpoint, the result was "verified" and the payment status was "completed".

However I noticed 30 seconds delay.


In order to get my code to work I had to make 2 modifications:

1) add "Connetion: Close" in the header (otherwise the connection was "hanging" and generated an error message "fgets ssl: connection reset by peer")

    $header .= "Connection: Close\r\n"; 

2) trim the result

     if (strcmp (trim($result), "VERIFIED") == 0) {          // VALID PAYMENT!


Am I good to go?  Any idea what is causing the delays?


Thank you.

Who Me Too'd this topic