SSL
"Milan Tomic" <[email protected]> Tue, 26 Apr 2005 10:24:16 +0200
| Newsgroups | gmane.text.xml.soap.user |
|---|---|
| Message-ID | <021f01c54a39$58ed38a0$ce018ac1@Majestix> |
I've found this example for Apache SOAP (SSL):
System.setProperty("javax.net.ssl.trustStore","C:\\YourDirectory\\client
.keystore");
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.interna
l.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
This is not thread safe. I'd like to load key store and give it to
library, like in this Apache HttpClient example:
HttpClient httpclient = new HttpClient();
GetMethod httpget = new GetMethod("https://www.verisign.com/");
{
KeyStore ksTrustStore = KeyStore.getInstance("JKS");
FileInputStream fis = new
FileInputStream("C:/jdk1.5.0_01/jre/lib/security/cacerts.jks");
ksTrustStore.load(fis, "changeit".toCharArray());
fis.close();
Protocol myhttps = new Protocol("https",
new ManualSSLProtocolSocketFactory(ksTrustStore,
null,
""),
443);
Protocol.registerProtocol("https", myhttps);
httpclient.getHostConfiguration().setHost("https://www.verisign.com/",
443, myhttps);
}
httpclient.executeMethod(httpget);
Is it possible with Apache SOAP lib, or I have to switch to Axis or ...?
Thank you very much.