having deployed my application via webstart, the application
is unable to open https connections. http still works.
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: null;
targetException=java.lang.IllegalArgumentException: Error opening socket:
null]
at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown
Source)
at org.apache.soap.rpc.Call.invoke(Unknown Source)
at abfdv_client.Options.testConnection(Options.java:616)
...
for webstart i had to change the code to include https support. (from an
example
on javas developer forum)
static
{
// enable https connections
//Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
java.security.Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider());
java.net.URL.setURLStreamHandlerFactory(new
java.net.URLStreamHandlerFactory() {
public java.net.URLStreamHandler createURLStreamHandler(final String
protocol) {
if ("https".equals(protocol)) {
return new
com.sun.net.ssl.internal.www.protocol.https.Handler();
}
return null;
}
});
// This is a kludge to get JSSE to use the cacerts keystore from
WebStart
// not sure if i need it
if (System.getProperty("javawebstart.version") != null) {
System.setProperty("javax.net.ssl.trustStore",
System.getProperty("jnlpx.home") + System.getProperty("file.separator") +
"cacerts");
if (System.getProperty("javax.net.ssl.trustStorePassword") == null)
{
System.setProperty("javax.net.ssl.trustStorePassword",
"changeit");
}
}
}
this new code still works from the command line.
- tested 1.3.1-b24 and 1.4.0-b96 both from command line and webstart
- i think i got all necessary jar included:
<resources>
<j2se version="1.3+" max-heap-size="256M"/>
<jar href="lib/abfdv_client.jar"/>
<jar href="lib/activation.jar"/>
<jar href="lib/imap.jar"/>
<jar href="lib/jakarta-oro-2.0.3.jar"/>
<jar href="lib/mail.jar"/>
<jar href="lib/mailapi.jar"/>
<jar href="lib/pop3.jar"/>
<jar href="lib/smtp.jar"/>
<jar href="lib/xerces.jar"/>
<jar href="lib/soap_n.jar"/>
<jar href="lib/jsse.jar"/>
<jar href="lib/jnet.jar"/>
<jar href="lib/jcert.jar"/>
<jar href="lib/cmp.jar"/>
<jar href="lib/icons.jar"/>
</resources>