1

I am trying to connect to the eTrade API which uses OAuth. I am trying to request a token.

The domain I am trying to connect with has an SSL certificate.

The connection uses TLS 1.2. The connection is encrypted and authenticated using AES_128_GCM and uses ECDHE_RSA as the key exchange mechanism.

Here is the exact error I am getting

Caught exception Error Code : 1001 Error Message : Error no : 35 Error : Unknown SSL protocol error in connection to etws.etrade.com:443 #0 /home/detroitclicks/public_html/etrade/Common/etHttpUtils.class.php(174): etHttpUtils->DoHttpRequest() #1 /home/detroitclicks/public_html/etrade/OAuth/etOAuth.class.php(58): etHttpUtils->GetResponse() #2 /home/detroitclicks/public_html/etrade/Samples/test_etOAuth.php(54): etOAuth->GetRequestToken() #3 {main} Exiting...

I'm not sure if this matters, but I have this set up in one of my php files:

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
Bruce
  • 107
  • 1
  • 3
  • 8

1 Answers1

1
The connection uses TLS 1.2.   
....
curl_setopt($ch, CURLOPT_SSLVERSION, 3);

There is a mismatch between the requirement for TLS 1.2 and the explicit setting of version 3 (SSL 3.0) with CURLOPT_SSLVERSION. Just remove this setting and it should try the best it can. It might still fail if your local SSL stack does not support TLS 1.2 yet.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
  • that worked. thank you very much. I was working with etrade API and I am wondering why they would include that? – Bruce Nov 16 '14 at 16:36
  • This is probably old and was maybe added in former times to work around some problems. But with abandoning SSL 3.0 everywhere this is obsolete. – Steffen Ullrich Nov 17 '14 at 07:57