[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Jessie-discuss] Re: please help me.
From: |
Martin Egholm Nielsen |
Subject: |
Re: [Jessie-discuss] Re: please help me. |
Date: |
Wed, 20 Sep 2006 13:28:39 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050319 |
Hi,
>> *got the errors at the testclient:*
>>
>> javax.net.ssl.SSLPeerUnverifiedException: could not verify peer
>> certificate:
>> C=US,ST=CA,L=City,CN=localhost,address@hidden
>> <mailto:address@hidden>
>
> You need to set up a trusted key store that contains the
> certificate that signed the server certificate you are using.
>
> Alternatively, you can set the security property
> "jessie.certificate.handler" to
> "org.metastatic.jessie.ConsoleCertificateHandler". That will make
> jessie
> ask you if it is OK to connect to a sever that presented an
> unverifiable certificate.
thank you for your answer.
I have tried to change only in testclient.java :
java.security.Security.setProperty("jessie.certificate.handler",
"org.metastatic.callbacks.ConsoleCallbackHandler"); to
java.security.Security.setProperty("org.metastatic.jessie.ConsoleCertificateHandler",
"org.metastatic.callbacks.ConsoleCallbackHandler");
But the errors are same as before. Then I checked the glibj.zip of
classpath-0.92. There is no ConsoleCertificateHandler.class in
glibj.zip, but the ConsoleHandler in /java/util/logging.
ConsoleCallbackHandler is now in /gnu/javax/security/auth/callback/.
Yes, Jessie is AFAIR no longer standalone, but integrated in GNU
Classpath - and namespace has changed.
and then I got the mail from you.
So I have olny changed my testclient and attached your code in them.
But it doesn't work. The errors are the same as before. Please see my
testclient.java in attachment whether I have done it correctly.
(Not having tried it myself) I suggest you try either of the two:
===== 1 =====
- ctx.init(null, null, null);
+ ctx.init(null, trustAll, new java.security.SecureRandom());
or:
===== 2 =====
- try
- {
- javax.net.ssl.SSLContext sc =
+ javax.net.ssl.SSLContext sc = null;
+ try
+ {
+ sc =
- SSLContext ctx = SSLContext.getInstance("SSLv3", "Jessie");
- ctx.init(null, null, null);
+ SSLContext ctx = sc;
Where "-" means find and remove this line and replace with the one
indicated with "+".
// Martin