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 in Java by Soham
• 9,150 points
3,193 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 by Aditya
• 7,660 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,900 points
4,361 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
999 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,900 points
621 views
+1 vote
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
203,677 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,350 points
4,533 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
36,095 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,720 points
277 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP