Re: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connecti

2007-08-28 スレッド表示 Freya

Same issue over here, anyone ideas how this was solved?



YJO wrote:
> 
> Hi,
> 
> I'am accessing a webservice throug a proxy (that requeries authentication)
> over SSL and I keep getting this message : javax.net.ssl.SSLException:
> Unrecognized SSL message, plaintext connection?
> 
> This is what I do ?
> 
> System.setProperty("javax.net.ssl.keyStore", keystoreUri);
> System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
> System.setProperty("javax.net.ssl.keyStoreType", "JKS");
> 
> System.setProperty( "java.protocol.handler.pkgs",
> "com.sun.net.ssl.internal.www.protocol" );
> 
> System.setProperty("javax.net.ssl.trustStore", truststoreUri);
> System.setProperty("javax.net.ssl.trustStorePassword",
> "changeit");
> 
> System.setProperty("http.proxySet", "true");
> System.setProperty("http.proxyHost", "");
> System.setProperty("http.proxyPort", "80");
> System.setProperty("http.proxyUser", "");
> System.setProperty("http.proxyPassword", "");
> 
> System.setProperty("https.proxySet", "true");
> System.setProperty("https.proxyHost", "");
> System.setProperty("https.proxyPort", "443");
> System.setProperty("https.proxyUser", "");
> System.setProperty("https.proxyPassword", "");
> System.setProperty("java.net.debug", "all");
> 
> 
> Acessing the url of the webservice via the browser works fine also setting
> up a communication like here (see below) works fine. Yet the axis API
> doesn't offer me this to do(or am I wrong).
> 
> try {
>   javax.net.ssl.HttpsURLConnection connection =
> (javax.net.ssl.HttpsURLConnection)new
> URL("https://gmail.com";).openConnection();
>   String encoded = new
> String(org.apache.commons.codec.binary.Base64.encodeBase64(new
> String(":").getBytes()));
>   connection.setRequestProperty("Proxy-Authorization", "Basic " +
> encoded);
>   
>   connection.setHostnameVerifier(new HostnameVerifier(){
>   public boolean verify(String urlHostName, SSLSession 
> session) {
>   return true;
>   }
>   });
> 
>   connection.connect();
>   boolean b = connection.usingProxy();
>   BufferedInputStream i = new
> BufferedInputStream(connection.getInputStream());
>   StringBuffer sb = new StringBuffer();
> int c = 0;
> while ((c = i.read()) != -1) {
> sb.append((char) c);
> }
>   
>   System.out.println("end");
>   } catch (MalformedURLException e) {
>   // TODO Auto-generated catch block
>   e.printStackTrace();
>   } catch (IOException e) {
>   // TODO Auto-generated catch block
>   e.printStackTrace();
> }
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/javax.net.ssl.SSLException%3A-Unrecognized-SSL-message%2C-plaintext-connecti-tf1899618.html#a12363991
Sent from the Axis - Japanese Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: 
[メールアドレス保護]
For additional commands, e-mail: 
[メールアドレス保護]



javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connecti

2006-07-06 スレッド表示 YJO

Hi,

I'am accessing a webservice throug a proxy (that requeries authentication)
over SSL and I keep getting this message : javax.net.ssl.SSLException:
Unrecognized SSL message, plaintext connection?

This is what I do ?

  System.setProperty("javax.net.ssl.keyStore", keystoreUri);
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
System.setProperty("javax.net.ssl.keyStoreType", "JKS");

System.setProperty( "java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol" );

System.setProperty("javax.net.ssl.trustStore", truststoreUri);
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "");
System.setProperty("http.proxyPort", "80");
System.setProperty("http.proxyUser", "");
System.setProperty("http.proxyPassword", "");

System.setProperty("https.proxySet", "true");
System.setProperty("https.proxyHost", "");
System.setProperty("https.proxyPort", "443");
System.setProperty("https.proxyUser", "");
System.setProperty("https.proxyPassword", "");
System.setProperty("java.net.debug", "all");


Acessing the url of the webservice via the browser works fine also setting
up a communication like here (see below) works fine. Yet the axis API
doesn't offer me this to do(or am I wrong).

try {
javax.net.ssl.HttpsURLConnection connection =
(javax.net.ssl.HttpsURLConnection)new
URL("https://gmail.com";).openConnection();
String encoded = new
String(org.apache.commons.codec.binary.Base64.encodeBase64(new
String(":").getBytes()));
connection.setRequestProperty("Proxy-Authorization", "Basic " +
encoded);

connection.setHostnameVerifier(new HostnameVerifier(){
public boolean verify(String urlHostName, SSLSession 
session) {
return true;
}
});

connection.connect();
boolean b = connection.usingProxy();
BufferedInputStream i = new
BufferedInputStream(connection.getInputStream());
StringBuffer sb = new StringBuffer();
int c = 0;
while ((c = i.read()) != -1) {
sb.append((char) c);
}

System.out.println("end");
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


-- 
View this message in context: 
http://www.nabble.com/javax.net.ssl.SSLException%3A-Unrecognized-SSL-message%2C-plaintext-connecti-tf1899618.html#a5196676
Sent from the Axis - User - Java forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]