You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Mark Claassen <mc...@ocie.net> on 2006/09/15 19:00:11 UTC

Unrecognized SSL message exception when using proxy

If I don't use a proxy server, everything works fine, but when I do I get
this exception.  I have no clue even where to start looking.  Our proxy
server doesn't say there are any errors.

I am using Netbeans and this error occurs while running it through the IDE.
However the error also occurs *at the same place* when I use webstart.
Webstart does not have a problem downloading the jar files through SSL and
the proxy, so I know that it works.

HttpClient 3.0.1, Java 5

---- 2 ---- Throwable - Class (class dsi.core.io.ConnectErrorException)
Message(Unrecognized SSL message, plaintext connection?)  ----
	at
dsi.joint.io.ApacheDConnection.sendSinglePart(ApacheDConnection.java:134)
	at dsi.joint.io.ApacheDConnection.send(ApacheDConnection.java:83)
	at dsi.joint.io.DConnection.sendRequestImpl(DConnection.java:103)
	at dsi.joint.io.DConnection.sendRequest(DConnection.java:70)
	at dsi.joint.io.IOHelper.loadServerList(IOHelper.java:43)
	at
dsi.client.module.ModuleController.loadServerList(ModuleController.java:1596
)
	at
dsi.client.module.ModuleController.access$1100(ModuleController.java:71)
	at
dsi.client.module.ModuleController$13.run(ModuleController.java:1431)
	at java.lang.Thread.run(Unknown Source)
---- 1 ---- Throwable - Class (class javax.net.ssl.SSLException)
Message(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.writeRecord(Unknown
Source)
	at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown
Source)
	at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
	at java.io.BufferedOutputStream.flush(Unknown Source)
	at org.apache.commons.httpclient.ChunkedOutputStream.flush(Unknown
Source)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


RE: Unrecognized SSL message exception when using proxy

Posted by Mark Claassen <mc...@ocie.net>.
Thanks for the reply.  I checked this again this morning, and the ports are
the same.
The toString() the the HttpClient yields:
(When Proxied) host=https://frisky:5406, proxyHost=http://InterNet:8080
(When not Proxied) host=https://frisky:5406 

However, your post got me thinking about other stupid mistakes I could have
been making, and I found that I made a mistake in my ProtocolSocketFactory
(I was not implementing SecureProtocolSocketFactory).  Making that change
fixed my problem!

Mark
 
-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Sunday, September 17, 2006 2:23 PM
To: HttpClient User Discussion
Subject: Re: Unrecognized SSL message exception when using proxy

On Fri, 2006-09-15 at 13:00 -0400, Mark Claassen wrote:
> If I don't use a proxy server, everything works fine, but when I do I 
> get this exception.  I have no clue even where to start looking.  Our 
> proxy server doesn't say there are any errors.
> 

Mark,

Most likely you have misconfigured HttpClient by giving it a wrong port
number or a protocol scheme, which causes HttpClient to attempt to establish
a SSL connection to an insecure (non-SSL) port.

Hope this helps

Oleg 


> I am using Netbeans and this error occurs while running it through the
IDE.
> However the error also occurs *at the same place* when I use webstart.
> Webstart does not have a problem downloading the jar files through SSL 
> and the proxy, so I know that it works.
> 
> HttpClient 3.0.1, Java 5
> 
> ---- 2 ---- Throwable - Class (class 
> dsi.core.io.ConnectErrorException)
> Message(Unrecognized SSL message, plaintext connection?)  ----
> 	at
> dsi.joint.io.ApacheDConnection.sendSinglePart(ApacheDConnection.java:134)
> 	at dsi.joint.io.ApacheDConnection.send(ApacheDConnection.java:83)
> 	at dsi.joint.io.DConnection.sendRequestImpl(DConnection.java:103)
> 	at dsi.joint.io.DConnection.sendRequest(DConnection.java:70)
> 	at dsi.joint.io.IOHelper.loadServerList(IOHelper.java:43)
> 	at
> dsi.client.module.ModuleController.loadServerList(ModuleController.jav
> a:1596
> )
> 	at
> dsi.client.module.ModuleController.access$1100(ModuleController.java:71)
> 	at
> dsi.client.module.ModuleController$13.run(ModuleController.java:1431)
> 	at java.lang.Thread.run(Unknown Source)
> ---- 1 ---- Throwable - Class (class javax.net.ssl.SSLException) 
> Message(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(Unk
> nown
> Source)
> 	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown
> Source)
> 	at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown
> Source)
> 	at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
> 	at java.io.BufferedOutputStream.flush(Unknown Source)
> 	at org.apache.commons.httpclient.ChunkedOutputStream.flush(Unknown
> Source)
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> httpclient-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: Unrecognized SSL message exception when using proxy

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2006-09-15 at 13:00 -0400, Mark Claassen wrote:
> If I don't use a proxy server, everything works fine, but when I do I get
> this exception.  I have no clue even where to start looking.  Our proxy
> server doesn't say there are any errors.
> 

Mark,

Most likely you have misconfigured HttpClient by giving it a wrong port
number or a protocol scheme, which causes HttpClient to attempt to
establish a SSL connection to an insecure (non-SSL) port.

Hope this helps

Oleg 


> I am using Netbeans and this error occurs while running it through the IDE.
> However the error also occurs *at the same place* when I use webstart.
> Webstart does not have a problem downloading the jar files through SSL and
> the proxy, so I know that it works.
> 
> HttpClient 3.0.1, Java 5
> 
> ---- 2 ---- Throwable - Class (class dsi.core.io.ConnectErrorException)
> Message(Unrecognized SSL message, plaintext connection?)  ----
> 	at
> dsi.joint.io.ApacheDConnection.sendSinglePart(ApacheDConnection.java:134)
> 	at dsi.joint.io.ApacheDConnection.send(ApacheDConnection.java:83)
> 	at dsi.joint.io.DConnection.sendRequestImpl(DConnection.java:103)
> 	at dsi.joint.io.DConnection.sendRequest(DConnection.java:70)
> 	at dsi.joint.io.IOHelper.loadServerList(IOHelper.java:43)
> 	at
> dsi.client.module.ModuleController.loadServerList(ModuleController.java:1596
> )
> 	at
> dsi.client.module.ModuleController.access$1100(ModuleController.java:71)
> 	at
> dsi.client.module.ModuleController$13.run(ModuleController.java:1431)
> 	at java.lang.Thread.run(Unknown Source)
> ---- 1 ---- Throwable - Class (class javax.net.ssl.SSLException)
> Message(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.writeRecord(Unknown
> Source)
> 	at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown
> Source)
> 	at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
> 	at java.io.BufferedOutputStream.flush(Unknown Source)
> 	at org.apache.commons.httpclient.ChunkedOutputStream.flush(Unknown
> Source)
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org