What development environment are you using? If you use NetBeans, you must install them in VMargs in /etc/netbeans.conf (this is necessary for the web service tool to function correctly so that you can create clients, for example):
<NETBEANS_HOME>/bin/netbeans.exe -J-Djavax.net.ssl.trustStore=<AS_HOME>/domains/domain1/config/cacerts.jks -J-Djavax.net.ssl.keyStore=<AS_HOME>/domains/domain1/config/keystore.jks -J-Djavax.net.ssl.trustStorePassword=changeit -J-Djavax.net.ssl.keyStorePassword=changeit
Also, make sure you set up storage correctly in GlassFish; add these lines in the same way as in the JVM option:
-Djavax.net.ssl.trustStore=${truststore.location} -Djavax.net.ssl.trustStorePassword=${ssl.password}
In addition, if it is not a valid certificate (for example, hostnames do not match, which is a common reason for javax.net.ssl.SSLHandshakeException ), you can make a workaround in the client web service for development / testing purposes:
static { //WORKAROUND. TO BE REMOVED. javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier( new javax.net.ssl.HostnameVerifier(){ public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) { if (hostname.equals("mytargethostname")) { //Change to actual value return true; } return false; } }); }
At the moment, I do not see the source of your problem, but these are some points that I think you need to eliminate.
source share