Note that there are some explanatory texts on larger screens.

plurals
  1. POWeb service not working on GlassFish server
    text
    copied!<p>I have created a web service in Java which posts data to another web service. This requires SSL certificates for authentication. This web service is running fine on Tomcat, but when I deploy the same code on GlassFish 3.0.1 server, I am getting <code>javax.net.ssl.SSLHandshakeException</code>: Received fatal alert: unknown ca exception. I have imported the certificate to glassfish trustStore using keytool. The required certificates are provided by client.</p> <p>My code:</p> <pre><code>System.setProperty("javax.net.ssl.keyStoreType" , "pkcs12"); System.setProperty("javax.net.ssl.keyStore", applicationRootDirPath + "clientCert.p12"); System.setProperty("javax.net.ssl.keyStorePassword", "password"); System.setProperty("javax.net.ssl.trustStoreType", "jks"); System.setProperty("javax.net.ssl.trustStore", "path of glass fish truststore"); System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); try { url = new URL(serverUrl); urlConn = url.openConnection(); urlConn.setDoOutput(true); urlConn.setRequestMethod("POST"); urlConn.setAllowUserInteraction(false); urlConn.setUseCaches(false); urlConn.setRequestProperty("Content-type", "text/xml; charset=utf-8"); urlConn.setRequestProperty("Content-Length", new Integer(xml.length()).toString()); try { writer = new OutputStreamWriter(urlConn.getOutputStream(), "UTF-8"); writer.write(xmlData); } finally { if (writer != null) { writer.close(); } } trace += "\n urlConn.getInputStream()"; in = urlConn.getInputStream(); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload