Thanks for your time to read my question - I am using Eclipse IDE.
I want Jsoup to connect a https url - https://www.icegate.gov.in/ using Document doc = Jsoup.connect("https://www.icegate.gov.in/").get();
but it giving error Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
while when i use same code for other https like linkedin then it works ... I don't know how to resolve this issue.
I got certificate of that website and installed in my jre/lib/security folder but it also not helped me.
How to add these certificate & jks in eclipse.
Here is my code:
public static void main(String[] args) throws IOException {
Document doc = Jsoup.connect("https://www.linkedin.com/in/xxxxxx").get();
Element summaryDetails = doc.getElementById("profile");
System.out.println("Summary Details is - "+ summaryDetails.text());
Document doc2 = Jsoup.connect("https://www.icegate.gov.in/").get();
}
And error I am getting is:
Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:512)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:493)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:205)
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:194)
at com.deepak.TestLinkedIn.main(TestLinkedIn.java:39)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:482)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)