Connection reset

While trying to use commonapi, I get this JAVA exception: Connection reset

Here is a snapshot of my code:

URL url = new URL(“” + postalCode + “&returnGeom=Y&getAddrDetails=Y&pageNum=1”);

HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty(“Accept”, “application/json”);

int response = conn.getResponseCode() != 200; /* The exception is thrown here */

Please tell me what I am doing wrong here.

Thank you!

Problem solved by adding this line to my code:
System.setProperty(“https.protocols”, “TLSv1.1,TLSv1.2,SSLv3,SSLv2Hello”);

Hi @fhassani,

For your app security concern, please only allow “TLSv1.1,TLSv1.2” only