Hi all,
I want to establish HTTPS connection connection between client and server.
I implemented the steps to created the required
certificate for Secure server and Secure client.
when I m running the "SecureServer.java".It is running properly but when
running the "SecureClient.java",
c:/j2sdk1.4.2/bin/java SecureClient https://192.168.10.160
during runtime we get exception that is given below.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
THE HEADERS
-----------
Exception in thread "main" java.io.IOException: HTTPS hostname wrong:
should be
<192.168.10.160>
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at sun.net.www.protocol.http.HttpURLConnection$6.run(
HttpURLConnection.j
ava:1202)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException
(HttpU
RLConnection.java:1196)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream
(HttpURLCon
nection.java:885)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
.getInputStream(HttpsURLConnectionOldImpl.java:204)
at Browser.run(Browser.java:36)
at SecureBrowser.main(SecureBrowser.java:14)
Caused by: java.io.IOException: HTTPS hostname wrong: should be <
192.168.10.160
>
at sun.net.www.protocol.https.HttpsClient.checkURLSpoofing(
HttpsClient.j
ava:490)
at sun.net.www.protocol.https.HttpsClient.afterConnect(
HttpsClient.java:
415)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:170)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream
(HttpURLCon
nection.java:913)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey
(HttpURL
Connection.java:1919)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
.getHeaderFieldKey(HttpsURLConnectionOldImpl.java:257)
at Browser.run(Browser.java:31)
... 1 more
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
When we are running the "SecureClient.java" from another m/c
c:\j2sdk1.4.2\bin java SecureClient 192.168.10.160
It gives the following error on client m/c
THE HEADERS
-----------
Exception in thread "main" java.io.IOException
at sun.net.www.protocol.http.HttpURLConnection.getInputStream
(HttpURLCon
nection.java:591)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
.getInputStream(DashoA6275)
at Browser.run(Browser.java:36)
at SecureBrowser.main(SecureBrowser.java:14)
Caused by: javax.net.ssl.SSLHandshakeException:
sun.security.validator.Validator
Exception: No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake
(DashoA6275)
at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(DashoA6275)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream
(HttpURLCon
nection.java:615)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey
(HttpURL
Connection.java:1485)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
.getHeaderFieldKey(DashoA6275)
at Browser.run(Browser.java:31)
... 1 more
Caused by: sun.security.validator.ValidatorException: No trusted certificate
fou
nd
at sun.security.validator.SimpleValidator.buildTrustedChain
(SimpleValida
tor.java:304)
at sun.security.validator.SimpleValidator.engineValidate
(SimpleValidator
.java:107)
at sun.security.validator.Validator.validate(Validator.java:202)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
DashoA6275)
at
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(
DashoA6275)
... 13 more
??????????????????????????????
if anyine knows the answer , plz help me
thanks in advance
Shalini


