php - cURL Unsupported SSL Protocol -


i have curl request fails when running through php 5.4.48 app. funny thing is, executes correctly when running directly through console, or through postman.

the api i'm connecting expects tlsv1.2 connection, specifying in app.

here's simple request in php app:

$ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://dev-dataconnect.givex.com:50104'); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_postfields,$payload);  curl_setopt($ch, curlopt_post, 1 ); curl_setopt($ch, curlopt_httpheader, array('content-type: text/plain;charset=utf-8'));  curl_setopt($ch, curlopt_sslversion, 6); // curl_setopt($ch, curlopt_sslversion, 'curl_sslversion_tlsv1_2'); // specifying value name of no curl_setopt($ch, curlopt_ssl_cipher_list, 'tls_rsa_with_aes_256_cbc_sha256');  curl_exec($ch); 

a raw curl request (note fires within console)

curl 'https://dev-dataconnect.givex.com:50104/' -h 'accept-encoding: gzip, deflate' -h 'accept-language: en-us,en;q=0.8' -h 'user-agent: mozilla/5.0 (macintosh; intel mac os x 10_10_5) applewebkit/537.36 (khtml, gecko) chrome/47.0.2526.111 safari/537.36' -h 'content-type: text/plain;charset=utf-8' -h 'accept: */*' -h 'cache-control: no-cache' -h 'connection: keep-alive' --data-binary $'{"method":"dc_909","id":"confidential","jsonrpc":"2.0","params":["en","confidential","29530","confidential"]}\n' --compressed 

also note didn't need specify ssl version successful handshake

here's printout running curl -v 'https://dev-dataconnect.givex.com:50104/'

* connected dev-dataconnect.givex.com (72.15.49.106) port 50104 (#0) * tls 1.2 connection using tls_rsa_with_aes_256_cbc_sha256 * server certificate: *.givex.com * server certificate: trustwave organization validation sha256 ca, level 1 * server certificate: securetrust ca > / http/1.1 > host: dev-dataconnect.givex.com:50104 > user-agent: curl/7.43.0 > accept: */* 

i'm running

 - php 5.4.48  - curl 7.43.0 (within both mamp , mac environments)  - openssl/0.9.8zd (within both mamp , mac environments) 

i've been troubleshooting issue since last week. ideas???

  • openssl/0.9.8zd (within both mamp , mac environments)

...

the api i'm connecting expects tlsv1.2 connection, specifying in app.

openssl 0.9.8 has no support tls 1.2. support added openssl 1.0.1.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -