You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by Jie SH Hu <hu...@cn.ibm.com> on 2010/10/26 05:18:48 UTC

How to make Wink Client accept all SSL certification?

Hi,

I am using Wink Client for testing. The server is providing https with a 
not trusted certification.
How to accept these non-trusted certification by using wink client?

Thank you~

Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization

Re: How to make Wink Client accept all SSL certification?

Posted by Jie SH Hu <hu...@cn.ibm.com>.
Jesse,


Thank you for your detailed support information~ 
I will have a try. 



Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization



From:
Jesse A Ramos <jr...@us.ibm.com>
To:
wink-user@incubator.apache.org
Date:
2010-10-29 21:29
Subject:
Re: How to make Wink Client accept all SSL certification?



Sorry, looks like that feature isn't in an official release yet. 

The option to bypass hostname verification was added via Wink-242 (
https://issues.apache.org/jira/browse/WINK-242).  It should be included 
the upcoming 1.1.2 release.  If you'd like to give it a try, you can 
download the latest snapshot build from the snapshot repository. 

https://repository.apache.org/content/repositories/snapshots/org/apache/wink/apache-wink/1.1.2-incubating-SNAPSHOT/ 


-- Jesse




From:        Jie SH Hu <hu...@cn.ibm.com> 
To:        wink-user@incubator.apache.org 
Date:        10/29/2010 12:41 AM 
Subject:        Re: How to make Wink Client accept all SSL certification? 



Hi, 

In my version of Wink(Apache 1.0 not much sure), there is no such API in 
ClientConfig. Which version did you mean? 


Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization 


From: 
Jesse A Ramos <jr...@us.ibm.com> 
To: 
wink-user@incubator.apache.org 
Date: 
2010-10-27 03:27 
Subject: 
Re: How to make Wink Client accept all SSL certification?





Hi, 

Have you tried using ClientConfig.setBypassHostnameVerification(true)? 

-- Jesse





From:        Jie SH Hu <hu...@cn.ibm.com> 
To:        wink-user@incubator.apache.org 
Date:        10/26/2010 05:16 AM 
Subject:        Re: How to make Wink Client accept all SSL certification? 



Thank you for the reply, but I have tried this before. 

I set the context before using wink client. 

SSLContext sc = SSLContext.getInstance("SSL"); 

sc.init(null, trustAllCerts, new java.security.SecureRandom()); 
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); 



But result with following error: 

java.io.IOException: HTTPS hostname wrong:  should be <{MY Server IP}> 
     at com.ibm.net.ssl.www2.protocol.https.c.b(c.java:40) 
     at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:23) 
     at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:62) 
     at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:42) 
     at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.processRequest(
HttpURLConnectionHandler.java:63) 
     at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.handle(
HttpURLConnectionHandler.java:46) 
     at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
     at 
org.apache.wink.client.internal.handlers.AcceptHeaderHandler.handle(
AcceptHeaderHandler.java:76) 
     at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
     at org.apache.wink.client.handlers.BasicAuthSecurityHandler.handle(
BasicAuthSecurityHandler.java:89) 
     at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
     at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:216) 
     at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:178) 
     at org.apache.wink.client.internal.ResourceImpl.get(
ResourceImpl.java:290) 
...... 
From: 
Jason Dillon <ja...@planet57.com> 
To: 
wink-user@incubator.apache.org 
Date: 
2010-10-26 11:38 
Subject: 
Re: How to make Wink Client accept all SSL certification?







You can install a dummy trust-all trustmanager. 

http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html 

--jason 


On Oct 25, 2010, at 8:18 PM, Jie SH Hu wrote: 

Hi, 

I am using Wink Client for testing. The server is providing https with a 
not trusted certification. 
How to accept these non-trusted certification by using wink client? 

Thank you~ 

Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization 







Re: How to make Wink Client accept all SSL certification?

Posted by Jesse A Ramos <jr...@us.ibm.com>.
Sorry, looks like that feature isn't in an official release yet.

The option to bypass hostname verification was added via Wink-242 (
https://issues.apache.org/jira/browse/WINK-242).  It should be included 
the upcoming 1.1.2 release.  If you'd like to give it a try, you can 
download the latest snapshot build from the snapshot repository.

https://repository.apache.org/content/repositories/snapshots/org/apache/wink/apache-wink/1.1.2-incubating-SNAPSHOT/

-- Jesse




From:   Jie SH Hu <hu...@cn.ibm.com>
To:     wink-user@incubator.apache.org
Date:   10/29/2010 12:41 AM
Subject:        Re: How to make Wink Client accept all SSL certification?



Hi, 

In my version of Wink(Apache 1.0 not much sure), there is no such API in 
ClientConfig. Which version did you mean? 


Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization 



From: 
Jesse A Ramos <jr...@us.ibm.com> 
To: 
wink-user@incubator.apache.org 
Date: 
2010-10-27 03:27 
Subject: 
Re: How to make Wink Client accept all SSL certification?




Hi, 

Have you tried using ClientConfig.setBypassHostnameVerification(true)? 

-- Jesse





From:        Jie SH Hu <hu...@cn.ibm.com> 
To:        wink-user@incubator.apache.org 
Date:        10/26/2010 05:16 AM 
Subject:        Re: How to make Wink Client accept all SSL certification? 



Thank you for the reply, but I have tried this before. 

I set the context before using wink client. 

SSLContext sc = SSLContext.getInstance("SSL"); 

sc.init(null, trustAllCerts, new java.security.SecureRandom()); 
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); 



But result with following error: 

java.io.IOException: HTTPS hostname wrong:  should be <{MY Server IP}> 
      at com.ibm.net.ssl.www2.protocol.https.c.b(c.java:40) 
      at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:23) 
      at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:62) 
      at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:42) 
      at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.processRequest(
HttpURLConnectionHandler.java:63) 
      at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.handle(
HttpURLConnectionHandler.java:46) 
      at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
      at 
org.apache.wink.client.internal.handlers.AcceptHeaderHandler.handle(
AcceptHeaderHandler.java:76) 
      at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
      at org.apache.wink.client.handlers.BasicAuthSecurityHandler.handle(
BasicAuthSecurityHandler.java:89) 
      at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
      at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:216) 
      at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:178) 
      at org.apache.wink.client.internal.ResourceImpl.get(
ResourceImpl.java:290) 
...... 

From: 
Jason Dillon <ja...@planet57.com> 
To: 
wink-user@incubator.apache.org 
Date: 
2010-10-26 11:38 
Subject: 
Re: How to make Wink Client accept all SSL certification?






You can install a dummy trust-all trustmanager. 

http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html 

--jason 


On Oct 25, 2010, at 8:18 PM, Jie SH Hu wrote: 

Hi, 

I am using Wink Client for testing. The server is providing https with a 
not trusted certification. 
How to accept these non-trusted certification by using wink client? 

Thank you~ 

Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization 






Re: How to make Wink Client accept all SSL certification?

Posted by Jie SH Hu <hu...@cn.ibm.com>.
Hi,

In my version of Wink(Apache 1.0 not much sure), there is no such API in 
ClientConfig. Which version did you mean?


Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization



From:
Jesse A Ramos <jr...@us.ibm.com>
To:
wink-user@incubator.apache.org
Date:
2010-10-27 03:27
Subject:
Re: How to make Wink Client accept all SSL certification?



Hi, 

Have you tried using ClientConfig.setBypassHostnameVerification(true)? 

-- Jesse





From:        Jie SH Hu <hu...@cn.ibm.com> 
To:        wink-user@incubator.apache.org 
Date:        10/26/2010 05:16 AM 
Subject:        Re: How to make Wink Client accept all SSL certification? 



Thank you for the reply, but I have tried this before. 

I set the context before using wink client. 

SSLContext sc = SSLContext.getInstance("SSL"); 

sc.init(null, trustAllCerts, new java.security.SecureRandom()); 
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); 



But result with following error: 

java.io.IOException: HTTPS hostname wrong:  should be <{MY Server IP}> 
       at com.ibm.net.ssl.www2.protocol.https.c.b(c.java:40) 
       at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:23) 
       at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:62) 
       at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:42) 
       at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.processRequest(
HttpURLConnectionHandler.java:63) 
       at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.handle(
HttpURLConnectionHandler.java:46) 
       at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
       at 
org.apache.wink.client.internal.handlers.AcceptHeaderHandler.handle(
AcceptHeaderHandler.java:76) 
       at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
       at org.apache.wink.client.handlers.BasicAuthSecurityHandler.handle(
BasicAuthSecurityHandler.java:89) 
       at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
       at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:216) 
       at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:178) 
       at org.apache.wink.client.internal.ResourceImpl.get(
ResourceImpl.java:290) 
...... 


From: 
Jason Dillon <ja...@planet57.com> 
To: 
wink-user@incubator.apache.org 
Date: 
2010-10-26 11:38 
Subject: 
Re: How to make Wink Client accept all SSL certification?





You can install a dummy trust-all trustmanager. 

http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html 

--jason 


On Oct 25, 2010, at 8:18 PM, Jie SH Hu wrote: 

Hi, 

I am using Wink Client for testing. The server is providing https with a 
not trusted certification. 
How to accept these non-trusted certification by using wink client? 

Thank you~ 

Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization 






Re: How to make Wink Client accept all SSL certification?

Posted by Jesse A Ramos <jr...@us.ibm.com>.
Hi,

Have you tried using ClientConfig.setBypassHostnameVerification(true)?

-- Jesse





From:   Jie SH Hu <hu...@cn.ibm.com>
To:     wink-user@incubator.apache.org
Date:   10/26/2010 05:16 AM
Subject:        Re: How to make Wink Client accept all SSL certification?



Thank you for the reply, but I have tried this before. 

I set the context before using wink client. 

SSLContext sc = SSLContext.getInstance("SSL"); 

sc.init(null, trustAllCerts, new java.security.SecureRandom()); 
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); 



But result with following error: 

java.io.IOException: HTTPS hostname wrong:  should be <{MY Server IP}> 
        at com.ibm.net.ssl.www2.protocol.https.c.b(c.java:40) 
        at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:23) 
        at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:62) 
        at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:42) 
        at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.processRequest(
HttpURLConnectionHandler.java:63) 
        at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.handle(
HttpURLConnectionHandler.java:46) 
        at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
        at 
org.apache.wink.client.internal.handlers.AcceptHeaderHandler.handle(
AcceptHeaderHandler.java:76) 
        at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
        at 
org.apache.wink.client.handlers.BasicAuthSecurityHandler.handle(
BasicAuthSecurityHandler.java:89) 
        at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52) 
        at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:216) 
        at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:178) 
        at org.apache.wink.client.internal.ResourceImpl.get(
ResourceImpl.java:290) 
...... 



From: 
Jason Dillon <ja...@planet57.com> 
To: 
wink-user@incubator.apache.org 
Date: 
2010-10-26 11:38 
Subject: 
Re: How to make Wink Client accept all SSL certification?




You can install a dummy trust-all trustmanager. 

http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html 

--jason 


On Oct 25, 2010, at 8:18 PM, Jie SH Hu wrote: 

Hi, 

I am using Wink Client for testing. The server is providing https with a 
not trusted certification. 
How to accept these non-trusted certification by using wink client? 

Thank you~ 

Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization 





Re: How to make Wink Client accept all SSL certification?

Posted by Jie SH Hu <hu...@cn.ibm.com>.
Thank you for the reply, but I have tried this before. 

I set the context before using wink client.

SSLContext sc = SSLContext.getInstance("SSL"); 

sc.init(null, trustAllCerts, new java.security.SecureRandom()); 
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); 



But result with following error:

java.io.IOException: HTTPS hostname wrong:  should be <{MY Server IP}>
        at com.ibm.net.ssl.www2.protocol.https.c.b(c.java:40)
        at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:23)
        at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:62)
        at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:42)
        at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.processRequest(
HttpURLConnectionHandler.java:63)
        at 
org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.handle(
HttpURLConnectionHandler.java:46)
        at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52)
        at 
org.apache.wink.client.internal.handlers.AcceptHeaderHandler.handle(
AcceptHeaderHandler.java:76)
        at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52)
        at 
org.apache.wink.client.handlers.BasicAuthSecurityHandler.handle(
BasicAuthSecurityHandler.java:89)
        at 
org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(
HandlerContextImpl.java:52)
        at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:216)
        at org.apache.wink.client.internal.ResourceImpl.invoke(
ResourceImpl.java:178)
        at org.apache.wink.client.internal.ResourceImpl.get(
ResourceImpl.java:290)
......




From:
Jason Dillon <ja...@planet57.com>
To:
wink-user@incubator.apache.org
Date:
2010-10-26 11:38
Subject:
Re: How to make Wink Client accept all SSL certification?



You can install a dummy trust-all trustmanager.

http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html

--jason


On Oct 25, 2010, at 8:18 PM, Jie SH Hu wrote:

Hi, 

I am using Wink Client for testing. The server is providing https with a 
not trusted certification. 
How to accept these non-trusted certification by using wink client? 

Thank you~ 

Thanks & Regards,
胡捷(Hu Jie) / Victor

Globalization Tools Development, IBM China Development Lab
Email:hujiesh@cn.ibm.com
Tel:(86)021-60922994
Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New 
District, Shanghai 201203, China
Our Web Site:
http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization 





Re: How to make Wink Client accept all SSL certification?

Posted by Jason Dillon <ja...@planet57.com>.
You can install a dummy trust-all trustmanager.

http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html

--jason


On Oct 25, 2010, at 8:18 PM, Jie SH Hu wrote:

> Hi, 
> 
> I am using Wink Client for testing. The server is providing https with a not trusted certification. 
> How to accept these non-trusted certification by using wink client? 
> 
> Thank you~ 
> 
> Thanks & Regards,
> 胡捷(Hu Jie) / Victor
> 
> Globalization Tools Development, IBM China Development Lab
> Email:hujiesh@cn.ibm.com
> Tel:(86)021-60922994
> Adress:Building 10, 399 Keyuan Road, Zhangjiang Hi-Tech Park, Pudong New District, Shanghai 201203, China
> Our Web Site:http://ut.cn.ibm.com/CDL_SH_Website.nsf/ContentDocsByTitle/Team%20-%20Globalization