1

When accessing the Nest API from my java app to return the devices, I'm getting the following error:

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

The same URL (of the form)

https://developer-api.nest.com/devices?auth=<access_token_ommited_here>

Works fine from my browser. I suspect I'm missing a cert. Does anyone know how to resolve this issue?

user2600346
  • 81
  • 1
  • 3
  • [I'm seeing exactly the same thing](http://stackoverflow.com/questions/24415551/remote-host-closed-connection-during-handshake-with-nest-api) from the Force.com platform. Could you post information about your Java version, and the full stack trace? – metadaddy Jun 27 '14 at 00:28

3 Answers3

3

Ensure that your SSL library is using TLSv1 or higher security. If it's defaulting to SSLv3 or lower, the server will reject the connection.

1

I had to use TLSv1.1 to avoid strange SSL behaviour, the initial request would setup SSL correctly, but subsequent requests to the 307 redirected URL would fail SSL. Not 100% it is working perfectly yet but seems to be more stable.

System.setProperty("https.protocols", "TLSv1.1");
Nick
  • 61
  • 1
  • 1
0

System.setProperty("https.protocols", "TLSv1");

Ask4Gilles
  • 61
  • 1
  • 10