Hi
When I make a connection with HttpClient 4.0.1, I get this message:
hostname in certificate didn't match: <1.2.3.4> != <*.testing.com>
However when I go to my site in any browser, the certificate is for
"*.testing.com" so I was wondering where the hostname is being converted to an
IP address. In my code (where I make the connection) I use the hostname
"something.testing.com" which as far as I can make out, should work.
I'm quite new to this, and this seems to be slightly different to other posts
I've found on the same exception so if anyone could give me some tips I would
really appreciate it.
Thanks
Richard
PS This is my code by the way (I'm using BASIC authentication as the site uses
authentication)
String url = protocol + "://" + hostname + ":" + port + path;
log.debug("Authenticating user " + userName + " against URL: " + url);
// Set up the connection objects
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getCredentialsProvider().setCredentials(
new AuthScope(hostname, port, AuthScope.ANY_REALM, authScheme),
new UsernamePasswordCredentials(userName, password));
HttpGet httpget = new HttpGet(url);
log.debug("Executing request " + httpget.getRequestLine());
HttpResponse response = httpclient.execute(httpget);
________________________________
This e-mail and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you have received this e-mail in error please notify the sender (as shown
above). Kindly do not reproduce, print or forward any material received in
error, please delete it immediately. Pharos Communications Limited (Company No.
3458137) is incorporated in England and Wales and has its registered office at
83 London Street, Reading, Berkshire, UK, RG1 4QA.
Pharos Communications Pte Limited (Company No. 200817005N) is incorporated in
Singapore and has its registered office at One Marina Boulevard, #28-00.
Singapore 018989