{"action":"created","issue":{"url":"https://api.github.com/repos/LitleCo/litle-sdk-for-java/issues/43","labels_url":"https://api.github.com/repos/LitleCo/litle-sdk-for-java/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/LitleCo/litle-sdk-for-java/issues/43/comments","events_url":"https://api.github.com/repos/LitleCo/litle-sdk-for-java/issues/43/events","html_url":"https://github.com/LitleCo/litle-sdk-for-java/issues/43","id":108980842,"number":43,"title":"SSLHandshakeException on Sandbox","user":{"login":"thallium205","id":872832,"avatar_url":"https://avatars.githubusercontent.com/u/872832?v=3","gravatar_id":"","url":"https://api.github.com/users/thallium205","html_url":"https://github.com/thallium205","followers_url":"https://api.github.com/users/thallium205/followers","following_url":"https://api.github.com/users/thallium205/following{/other_user}","gists_url":"https://api.github.com/users/thallium205/gists{/gist_id}","starred_url":"https://api.github.com/users/thallium205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thallium205/subscriptions","organizations_url":"https://api.github.com/users/thallium205/orgs","repos_url":"https://api.github.com/users/thallium205/repos","events_url":"https://api.github.com/users/thallium205/events{/privacy}","received_events_url":"https://api.github.com/users/thallium205/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-29T23:31:41Z","updated_at":"2015-09-30T00:57:43Z","closed_at":null,"body":"My unit tests are failing for Litle these days where they used to work.  Below is the exception I am receiving. I am using the latest SDK as of today (8.29.3) and am using the following sandbox URL:\r\nurl=https://www.testlitle.com/sandbox/communicator/online\r\n\r\n```java\r\ncom.litle.sdk.LitleOnlineException: Exception connection to Litle\r\n\tat com.litle.sdk.Communication.requestToServer(Communication.java:81)\r\n\tat com.litle.sdk.LitleOnline.sendToLitle(LitleOnline.java:679)\r\n\tat com.litle.sdk.LitleOnline.sale(LitleOnline.java:332)\r\n\tat com.litle.sdk.LitleOnline.sale(LitleOnline.java:324)\r\nCaused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\r\n\tat sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)\r\n\tat sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)\r\n\tat sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)\r\n\tat sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)\r\n\tat org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)\r\n\tat org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:401)\r\n\tat org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)\r\n\tat org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)\r\n\tat org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)\r\n\tat org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)\r\n\tat org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)\r\n\tat org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)\r\n\tat org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)\r\n\tat org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)\r\n\tat com.litle.sdk.Communication.requestToServer(Communication.java:70)\r\n\t... 33 more\r\nCaused by: java.io.EOFException: SSL peer shut down incorrectly\r\n\tat sun.security.ssl.InputRecord.read(InputRecord.java:482)\r\n\tat sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)\r\n```\r\n\r\nDid the testing endpoint change?"},"comment":{"url":"https://api.github.com/repos/LitleCo/litle-sdk-for-java/issues/comments/144231330","html_url":"https://github.com/LitleCo/litle-sdk-for-java/issues/43#issuecomment-144231330","issue_url":"https://api.github.com/repos/LitleCo/litle-sdk-for-java/issues/43","id":144231330,"user":{"login":"thallium205","id":872832,"avatar_url":"https://avatars.githubusercontent.com/u/872832?v=3","gravatar_id":"","url":"https://api.github.com/users/thallium205","html_url":"https://github.com/thallium205","followers_url":"https://api.github.com/users/thallium205/followers","following_url":"https://api.github.com/users/thallium205/following{/other_user}","gists_url":"https://api.github.com/users/thallium205/gists{/gist_id}","starred_url":"https://api.github.com/users/thallium205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thallium205/subscriptions","organizations_url":"https://api.github.com/users/thallium205/orgs","repos_url":"https://api.github.com/users/thallium205/repos","events_url":"https://api.github.com/users/thallium205/events{/privacy}","received_events_url":"https://api.github.com/users/thallium205/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T00:57:43Z","updated_at":"2015-09-30T00:57:43Z","body":"I am able to communicate with the test server at 96.126.97.71 by manually adding TLSv1.2 as an enabled protocol when doing a GET.  However, the library is not doing this explicit add of this TLS version.  Is there some kind of explicit way of setting TLSv1.2 in the library?  Or is there some sort of way of setting it in the environment?\r\n\r\nExecuting this:\r\n```java\r\n        try {\r\n            String host = \"96.126.97.71\";\r\n            SSLSocketFactory factory =\r\n                    (SSLSocketFactory) SSLSocketFactory.getDefault();\r\n            SSLSocket socket = (SSLSocket) factory.createSocket(host, 443);\r\n            String[] protocols = socket.getEnabledProtocols();\r\n            System.out.println(\"Enabled Protocols: \");\r\n            for (int i = 0; i < protocols.length; i++) {\r\n                System.out.println(protocols[i] + \", \");\r\n            }\r\n            String[] supportedProtocols = socket.getSupportedProtocols();\r\n            System.out.println(\"Supported Protocols: \");\r\n            for (int i = 0; i < protocols.length; i++) {\r\n                System.out.println(supportedProtocols[i] + \", \");\r\n            }\r\n            String[] goodProtocols = new String[1];\r\n            goodProtocols[0] = \"TLSv1.2\";\r\n            socket.setEnabledProtocols(goodProtocols);\r\n            protocols = socket.getEnabledProtocols();\r\n            System.out.println(\"Set Protocols: \");\r\n            for (int i = 0; i < protocols.length; i++) {\r\n                System.out.println(protocols[i] + \", \");\r\n            }\r\n\r\n            socket.startHandshake();\r\n\r\n            PrintWriter out = new PrintWriter(\r\n                    new BufferedWriter(\r\n                            new OutputStreamWriter(\r\n                                    socket.getOutputStream())));\r\n\r\n            out.println(\"GET / HTTP/1.0\");\r\n            out.println();\r\n            out.flush();\r\n\r\n            if (out.checkError())\r\n                System.out.println(\r\n                        \"SSLSocketClient:  java.io.PrintWriter error\");\r\n\r\n            BufferedReader in = new BufferedReader(\r\n                    new InputStreamReader(\r\n                            socket.getInputStream()));\r\n\r\n            String inputLine;\r\n            while ((inputLine = in.readLine()) != null)\r\n                System.out.println(inputLine);\r\n\r\n            in.close();\r\n            out.close();\r\n            socket.close();\r\n\r\n        } catch (Exception e) {\r\n            e.printStackTrace();\r\n        }\r\n```\r\n\r\nResults in this:\r\n```java\r\nTLSv1,TLSv1.1,TLSv1.2\r\nEnabled Protocols: \r\nSSLv3, \r\nTLSv1, \r\nSupported Protocols: \r\nSSLv2Hello, \r\nSSLv3, \r\nSet Protocols: \r\nTLSv1.2, \r\nAdded Enabled Protocols: \r\nTLSv1.2, \r\nHTTP/1.1 200 OK\r\nDate: Wed, 30 Sep 2015 00:52:10 GMT\r\nServer: Apache-Coyote/1.1\r\nContent-Type: text/html;charset=ISO-8859-1\r\nContent-Length: 363\r\nSet-Cookie: JSESSIONID=B1360CD88C2AE1967D16C1729E658121; Path=/; HttpOnly\r\nConnection: close\r\n\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\r\n<html>\r\n<head>\r\n<title>Developers</title>\r\n<meta http-equiv=\"REFRESH\" content=\"3;url=http://www.litle.com/developers\"></HEAD>\r\n<BODY>\r\nYou are being redirected to http://www.litle.com/developers.  If you are not redirected, please click <a href=\"http://www.litle.com/developers\">Here</a>.\r\n</BODY>\r\n</HTML>\r\n```\r\n\r\nAs you can see, I am only able to contact the TLSv1.2 test server when I add it to the socket under setEnabledProtocols.  "}}