java - glassfish v3 "unable to find valid certification path to requested target" -
i realize question may appear duplicate, none of threads i've browsed seem address or situation.
i've been trying days create self-signed ssl certificate. certificate needed access glassfish domain must provide wsdl files through https. using glassfish 3.1.1 on solaris 10, not use default ssl port (443). @ moment, using 8181.
ssl certificates particular hostname used access them. certificate needs valid across several network zones; glassfish domain has more 1 different ip associated it. hostname (let's call foobar) not accessible outside server far can see.
after research decided need generate self-signed certificate subject alternative names indicating these ips. below steps took.
the easiest way generate cert san download java 7, includes keytool utility capability. download jdk 1.7.0_04 oracle website , install in foobar.
navigate glassfish domain1 configuration directory, e.g. /opt/glassfish3/glassfish/domains/domain1/config
(the following modified oracle glassfish 3.1 documentation: http://docs.oracle.com/cd/e18930_01/html/821-2435/ablqz.html)
generate certificate in keystore. note: each glassfish domain has own keystore; cert below generated domain1, associated https port 8181.
keytool -genkey -alias foobar -keyalg rsa -dname "cn=foobar, ou=xxxxxxx xxxx, o=xxxxxxxxxx, l=xxxxx xxx, s=xx, c=xx" -ext "san=ip:12.34.56.78,ip:99.88.77.66" -keypass changeit -storepass changeit -validity 3650 -keystore keystore.jksexport generated certificate file (in case, foobar.cer)
keytool -export -alias foobar -storepass changeit -file foobar.cer -keystore keystore.jksimport certificate cacerts trusted certificate. twice, once glassfish cacerts file, , once java jre cacerts file on foobar.
keytool -import -v -trustcacerts -alias foobar -file foobar.cer -keypass changeit -storepass changeit -keystore cacerts.jksin /usr/java/jre/lib/security:
keytool -import -v -trustcacerts -alias foobar -file foobar.cer -keypass changeit -storepass changeit -keystore cacertsjust in case, downloaded , import certificate java jre cacerts file @ windows workstation accessing https (probably not necessary).
in c:\program files\java\jre\lib\security:
keytool -import -v -trustcacerts -alias foobar -file foobar.cer -keypass changeit -storepass changeit -keystore cacertsrestart glassfish domain1.
asadmin restart-domain domain1after restart complete, test connection. in case go windows workstation have java app loaded in netbeans. run test wsdl needed through https, , enter
https://12.34.56.78:8181source.
this gives me following error:
2012-06-05 10:25:32,132 warn utilities.connectionmanager - not connect url https://12.34.56.78:8181/foobar/webservice?wsdl: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target if instead use default glassfish ssl certificate domain1, instead error indicating no subject alternative names present. that's why went through trouble of regenerating cert in first place.
as far can tell, importing certificate trusted ca certificate ought solve "unable find valid certification path" error. admit i'm not of network specialist of research far indicates case. i'm not sure if problem here because i'm using non-standard ssl port (having add :8181 may lead mismatch san ip). haven't tried yet. isn't there way generate self-signed cert ip:port combination, either in cn or san?
thanks... appreciated!
p.s. can provide application code if necessary.
it's been quite time since had problem.
i couldn't solve described above, ended ordering ssl certs public ca.
i did run 1 notable quirk concerning glassfish (3.1.1) , ssl. whatever reason, @ least 1 non-ssl enabled network listener needs exist per domain, or you'll certificate errors when accessing ssl enabled web service urls.
so have listener on 8080 , 8181. if both ssl enabled certs won't work. if ssl removed 8080, cert attached listener 8181 work.
Comments
Post a Comment