Unrecognized SSL message plaintext connection Exception

0 votes

I have a java compile package to speak with the https server on the net. Running the compilation gives the following exception:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? 
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source) 
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source) 
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source) 
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) 
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source) 
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source) 
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source) 
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)

I think this is due to the reason that the connection established with the client machine is not secure and hence, is there any way to configure the local machines in order to connect to the remote https server?

Feb 22, 2022 in Java by Soham
• 9,710 points
12,095 views

1 answer to this question.

0 votes
It is due to the fact that you are talking to an HTTP server, not an HTTPS server. Probably you didn't use the correct port number for HTTPS.
answered Feb 22, 2022 by Aditya
• 7,680 points

Related Questions In Java

0 votes
2 answers
0 votes
2 answers

Connection reset : java.net.SocketException

You should check whether the client program is ...READ MORE

answered Sep 6, 2018 in Java by Sushmita
• 6,920 points
5,827 views
0 votes
1 answer

Exception coming "android.os.NetworkOnMainThreadException"

This exception is thrown when an application ...READ MORE

answered Jun 6, 2018 in Java by poorvi
• 160 points
1,395 views
0 votes
2 answers

How can we assert, that a certain Exception is thrown in JUnit 4 tests?

@Test(expected = IndexOutOfBoundsException.class) public void testIndexOutOfBoundsException() { ...READ MORE

answered Dec 10, 2018 in Java by Sushmita
• 6,920 points
1,503 views
+2 votes
13 answers

How does java.net.SocketException: Connection reset happen ?

You can use wireshark to view the ...READ MORE

answered Dec 7, 2018 in Java by tushh
252,637 views
0 votes
1 answer

org.xml.sax.SAXParseException: How to handle this exception?

This is often caused by a white ...READ MORE

answered Jul 9, 2018 in Java by sharth
• 3,370 points
5,989 views
0 votes
2 answers

Unable to find valid certification path to requested target

Unfortunately - it could be many things ...READ MORE

answered Dec 15, 2020 in Java by Roshni
• 10,520 points
42,279 views
0 votes
1 answer

How to add https security for Node js?

You need to add the key and cert to the createServer function. const options ...READ MORE

answered Aug 10, 2018 in Blockchain by digger
• 26,740 points
717 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP