ctakahashi / rest-client

Automatically exported from code.google.com/p/rest-client
Apache License 2.0
0 stars 0 forks source link

HostnameVerifier trusting all hosts #177

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. connect to a site with a certificate which hostname is not matching the real 
host name

What is the expected output? What do you see instead?
it should be possible to ignore the error. instead the following error shows:
hostname in certificate didn't match: <xxx> != <yyyy> OR ...
javax.net.ssl.SSLException: hostname in certificate didn't match: 
...

What version of the product are you using? On what operating system?

Please provide any additional information below.

this can be circumvented by doing in the code:
    // Create all-trusting host name verifier
    HostnameVerifier allHostsValid = new HostnameVerifier() {
          public boolean verify(String hostname, SSLSession session) {
            return true;
          }
        };
    HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);

Original issue reported on code.google.com by rupert.t...@gmail.com on 1 Jul 2013 at 1:48

GoogleCodeExporter commented 8 years ago
i guess that one can be closed. there is an option in "SSL" to do exactly this.

Original comment by rupert.t...@gmail.com on 1 Jul 2013 at 3:03

GoogleCodeExporter commented 8 years ago
i tried to use a p12 certificate as client for client authentication in "SSL", 
the error i got was:
java.io.IOException: Invalid keystore format

Original comment by rupert.t...@gmail.com on 1 Jul 2013 at 3:10

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
For #2 created a new  Issue 178 . Closing this one.

Original comment by subwiz on 3 Jul 2013 at 3:58