PayU-EMEA / openpayu_php

OpenPayu SDK
http://developers.payu.com
Apache License 2.0
187 stars 87 forks source link

message=error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version #93

Closed rafalveeo closed 6 years ago

rafalveeo commented 6 years ago

I have error:

Uncaught exception 'OpenPayU_Exception' with message 'Oauth error: [code=0], [message=error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version]'

rafalveeo commented 6 years ago

I have SSL in TLS 1.0 version on my server, which PayU require from 30 June TLS 1.2.

mossaab commented 6 years ago

Replace following curl_setopt($ch, CURLOPT_SSLVERSION, 3); With curl_setopt ($ch, CURLOPT_SSLVERSION, 6); Should work flawlessly.

rafalveeo commented 6 years ago

Thanks for the reply.

From 30 June PayU required only TLS 1.2: http://developers.payu.com/pl/overview.html#encryption

So, I was made the test script: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://secure.payu.com/api/v2_1/orders"); curl_setopt ($ch, CURLOPT_SSLVERSION, 6); var_dump(curl_exec($ch)); var_dump(curl_error($ch)); And see this error.

I have SSL certificate on my server in TLS 1.0 version and i must change it.