Thanks Steve.
IBM article is really helpful.
I am using self signed certificate.
1) I generated server keystore.
2) Exported sever certificate from this keystore
3) Imported this server certificate to client keystore(clientTrustStore).
and set these property in my Axis2 client.
System.setProperty("javax.net.ssl.trustStore",
"C:/cert/clientTrustStore");
System.setProperty("javax.net.ssl.trustStorePassword", "passwd");
Still its giving error at client
Exception in thread "main" java.lang.NoClassDefFoundError
at javax.crypto.Cipher.getInstance(DashoA12275)
at com.sun.net.ssl.internal.ssl.JsseJce.getCipher(Unknown Source)
at com.sun.net.ssl.internal.ssl.RSACipher.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.RSACipher.getInstance(Unknown Source)
at com.sun.net.ssl.internal.ssl.PreMasterSecret.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverHelloDone(Unknown
Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown
Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at java.io.FilterOutputStream.flush(Unknown Source)
at
org.apache.commons.httpclient.ChunkedOutputStream.flush(ChunkedOutputStream.java:190)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
at
org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:118)
at
org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:422)
at
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:68)
at
org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:495)
at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:520)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
--Regards
Prash
On Fri, May 23, 2008 at 12:29 AM, <[EMAIL PROTECTED]> wrote:
> You've only generated the public/private keypair that goes in the
> server-side keystore.
> You'll also need to generate a certificate for the public key of that pair
> and send that to a certificate authority to sign.
> Then the public key certificate of that authority needs to be in the
> client's keystore.
>
> [1] has some good information about generating certs etc (but isn't
> specifically intended for SSL)
> [2] is specifically for SSL (and basic authentication.
>
>
> [1] http://wso2.org/library/174
>
> [2] http://www.ibm.com/developerworks/library/ws-sec1.html
>
> Hope this helps,
> Steve
>
> ______________________________________________
> Steve Gruverman
> IntelliCare, Inc. | A Medco Health Solutions Company
>
>
>
> "prashants b" <[EMAIL PROTECTED]> wrote on 05/22/2008
> 09:49:40 AM:
> > Generated keystore file I copied at location C:/cert
> > In Axis2 client I set the system properties as
> >
> > System.setProperty("javax.net.ssl.trustStore", "C:/cert/.keystore");
> > System.setProperty("javax.net.ssl.trustStorePassword", "mypassword");
> >
> > If I am not wrong this is the only required thing to set in client
> > to call WS through SSL.
> > What am I missing here, as getting this exception at client
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>