Unrecognized Ssl Message Plaintext Connection Spring Boot

Hi All

I am getting the following message when run my application

Caused by: javax.net.ssl.SSLException: Unrecognized SSL message,
plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.b(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)

Let me give a brief overview of my application.
This is a FTPS (NOT SFTP) client connecting to the FTP server on port
990. I am trying to connect to the server download the server
certificate and then load it dynamically in the trustmanager and then
do the normal FTP operations.
The application connects fine for downloading the ceritificate,
logging in and getting the initial working directory details. Thereon
any operation throws me this error.

CDIER0961E: The REST step is unable to invoke the REST service, cause=javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? The scenario is as follows: I need to retrieve a token to be used in all following calls to the API. Expected Behavior SMTP TLS and SSL should send email using configured smtp details. Current Behavior Both TLS and SSL setting are failing for Spring javax mail. SMTP TLS is failing with 'Could not convert socket to TLS' I set the below g.

Any ideas are welcome.

Thanks in advance



推荐:Unrecognized SSL message, plaintext connection

本文来自: 高爽 Coder,原文地址: http://blog.csdn.net/ghsau/article/details/17779165,转载请注明。 以这个错误信息为文章标题是不是更醒目

up vote 73 down vote favorite 7 I have a java complied package to speak with the https server on 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)

Step 1: After you install Password Recovery Bundle (ZIP Password Recovery is one of tools in it) on your computer, run it. Step 2: Choose “Recover Passwords for Files and Archives” in the main interface. Step 3: In the next window you need to choose “ZIP Password Recovery” among the 7 available tools. Password Recovery Bundle offers support for Google Talk, Pidgin, Outlook, Thunderbird, Opera, Firefox, SeaMonkey, RAR, ZIP, and many others. Plus, you can create a Windows password reset boot disk. How to Recover ZIP Password with ZIP Password Recovery. ZIP Password Recovery is an excellent solution in Password Recovery Bundle, so if you lost or forgot ZIP file password, download and install. Now choose “ZIP Password Recovery” to enter. If you lost or forgot password for. Reset Windows Password. Instantly bypass, unlock or reset lost administrator and other account. Password recovery bundle zip. Free download Password Recovery Bundle.zip by using Hacking Software Download Center (HSDC). This Password Recovery Bundle.zip software mainly categories in System-Hacking section. Also You can find out many software like Password Recovery Bundle.zip.

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 connection established with the client machine is not secure. Is there any way to configure the local machine or ports in order to connect to the remote https server? java https

this question edited Aug 4 '13 at 16:31 Eric Leschinski 57.4k 28 246 215 asked Jun 30 '11 at 8:49 karthi 645 3 18 26

12 Answers

up vote 102 down vote ---Accepted---Accepted---Accepted---

I think this is due to the connection established with the client machine is not secure. 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.

this answer edited Feb 23 '16 at 3:22 answered Jun 30 '11 at 11:00 EJP 216k 21 162 278 1 I have the same error, and I solved when I started using http instead of https. But when I place the link in browser with https it works! And I need to perform a safe query. Any idea on how can I solve the problem? – rsy Mar 31 '14 at 14:06 5 @rsy When you 'placed the link .. with https' the browser would have changed to port 443 for you. You can do the same yourself. Indeed HttpURLConnection will automatically do it for you, if you don't specify a port at all. – EJP Jun 9 '14 at 23:54

Unrecognized Ssl Message Plaintext Connection Spring Boot up vote 12 down vote javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

You should have a local SMTP domain name that will contact the mail server and establishes a new connection as well you should change the SSL property in your programming below javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection

props.put('mail.smtp.socketFactory.fallback', 'true'); // Should be true

this answer edited Aug 6 '16 at 1:05 EJP 216k 21 162 278 answered Mar 19 '13 at 10:03 Thobith 131 1 2 3 He is speaking HTTPS, not SMTP. -1 – EJP Feb 13 '14 at 2:02 In my case that worked, thanks! javax.mail.MessagingException: Could not connect to SMTP host: mail.livemusicgo.com, port: 25; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? – surfealokesea Apr 22 '14 at 5:49

up vote 5 down vote I got the same error message when I forgot to log in to the company firewall, before performing a POST request through a proxy.

this answer answered Apr 9 '13 at 12:01 Jay 198 3 17 I had to do the same although I was inside the company ! – MonoThreaded May 4 '16 at 14:19 up vote 0 down vote I got the same error. it was because I was accessing the https port using http. The issue solved when I changed http to https.

this answer answered Feb 3 '14 at 6:34 Soumyajit Swain 314 2 12 2 No, you got the error when accessing the HTTP port via HTTPS. Read the error message. You connected to a plaintext target. The situation you described wouldn't have caused an SSLException, as you wouldn't have been using SSL. – EJP Jul 2 '15 at 22:05 up vote 0 down vote I face the same issue from Java application built in Jdevelopr IDE. I solved the issue by unchecking the use of proxy form Project properties. You can find it in the following: Project Properties -> (from left panle )Run/Debug/Profile ->Click (edit) form the right panel -> Tool Setting from the left panel -> uncheck (Use Proxy) option.

this answer answered Aug 10 '14 at 14:23 Salman 583 1 12 37 up vote 0 down vote It worked for me now, I have change the setting of my google account as below:


final String username = '[email protected]';

final String password = '************';

Properties props = new Properties();

props.put('mail.smtp.auth', 'true');

props.put('mail.smtp.host', 'smtp.gmail.com');

props.put('mail.smtp.port', &quo

推荐:tomcat配置SSL时:java.lang.Exception: Socket bind failed:

tomcat报错: 2013-1-30 10:09:33 org.apache.coyote.http11.Http11AprProtocol start严重: Error starting endpointjava.lang.Exception: Socket bind fail


props.put('mail.transport.protocol', 'smtp');

props.put('mail.smtp.starttls.enable', 'true');

props.put('mail.smtp.starttls.enable', 'true');

props.put('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');

Session session = Session.getInstance(props,

new javax.mail.Authenticator() {

protected PasswordAuthentication getPasswordAuthentication() {

return new PasswordAuthentication(username, password);



try {

Transport transport=session.getTransport();

Message message = new MimeMessage(session);

message.setFrom(new InternetAddress('[email protected]'));//formBean.getString('fromEmail')

message.setRecipients(Message.RecipientType.TO,InternetAddress.parse('[email protected]'));




transport.send(message, InternetAddress.parse('[email protected]'));//(message);


} catch (MessagingException e) {



throw new RuntimeException(e);


Though I have enabled SSL and TSL while running program in this link of same post. I spend a lot of time but than I realized and found this link. And done 2 following steps and setting control in google. : Disable the 2-step verification (password and OTP) Enabling to allow to access less secure app(Allow less secure apps: ON.) Now I am able to send mail using above program.

this answer answered Feb 7 '16 at 7:45 Karo La 821 1 8 23 The question is about HTTPS. – EJP Jul 22 '16 at 7:07

up vote 0 down vote As EJP said, it's a message shown because of a call to a non-https protocol. If you are sure it is HTTPS, check your bypass proxy settings, and in case add your webservice host url to the bypass proxy list

this answer edited Aug 6 '16 at 1:04 EJP 216k 21 162 278 answered Sep 7 '15 at 17:02 Fabrizio Stellato 397 1 12 up vote 0 down vote Adding this as an answer as it might help someone later. I had to force jvm to use the IPv4 stack to resolve the error. My application used to work within company network, but while connecting from home it gave the same exception. No proxy involved. Added the jvm argument -Djava.net.preferIPv4Stack=true and all the https requests were behaving normally.

this answer answered Feb 6 at 20:47 basiljames 3,314 2 13 33 up vote 0 down vote if connection is FTPS test: FTPSClient ftpClient = new FTPSClient(protocol, false); protocol = TLS,SSL and false = isImplicit.

this answer answered Mar 22 at 17:57 Faxon 9 2 up vote -1 down vote Another reason is maybe 'access denided', maybe you can't access to the URI and received blocking response page for internal network access. If you are not sure your application zone need firewall rule, you try to connect from terminal,command line. For GNU/Linux or Unix, you can try run like this command and see result is coming from blocking rule or really remote address: echo nc -v yazilimcity.net 443

this answer edited May 9 at 19:24 answered May 9 at 12:20 oguzhankinik 19 4 up vote -3 down vote Maybe your default cerficate has expired. to renew it through admin console go 'Security >SSL certificate and key management > Key stores and certificates > NodeDefaultKeyStore > Personal certificates' select the 'default' alias and click on 'renew' after then restart WAS.

Ssl Connection Error

this answer answered Jul 10 '14 at 8:44 mbsau 200 2 13 1 An expired certificate rdies not cause this exception. – EJP Jul 2 '15 at 22:06 up vote -3 down vote If you're running the Java process from the command line on Java 6 or earlier, adding this switch solved the issue above for me: -Dhttps.protocols='TLSv1'

this answer answered Aug 18 '15 at 15:05 MarkL 40 1 No it didn't. It solved a different problem. – EJP Oct 14 '16 at 20:32 protected by Community♦ Feb 7 '16 at 15:06 Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count). Would you like to answer one of these unanswered questions instead? Not the answer you're looking for? Browse other questions tagged java https or ask your own question.

推荐:Android or java https ssl exception

1、http://www.trinea.cn/android/android-java-https-ssl-exception-2/ 2、http://www.eoeandroid.com/thread-161747-1-1.html 3、http://stackoverflow.com/qu

up vote 73 down vote favorite 7 I have a java complied package to speak with the https server on net. Running the compilation gives the following exception: javax.net.ssl.SSLExcept

Unrecognized Ssl Message Plaintext Connection Spring Boot Free

  • 1tomcat配置SSL时:java.lang.Exception: Socket bind failed:
  • 2Android or java https ssl exception

Unrecognized Ssl Message

  • 1微信公众号文章采集,并发布到WordPress
  • 2Unrecognized SSL message, plaintext connection?
  • 3Android or java https ssl exception
  • 4tomcat配置SSL时:java.lang.Exception: Socket bind failed:

Unrecognized Ssl Message Plaintext Connection


Unsupported Or Unrecognized Ssl Message

  • 1在阿里架构师眼中构建一个较为通用的业务技术架构就是如此简单
  • 2Java基础类String了解一下
  • 3中国民航飞行学院人事薪资管理系统实践案例
  • 4Java SE——线程介绍
  • 5简单的方法构建一个高可用服务端
  • 6CTO详细讲解海量日志处理ELK