Hi All,

Please let me know how to disable cert check from java code for https
jackrabbit url.

I tried below approaches but did not work.


*java -Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true -cp
target/mymvnproj-1.0-SNAPSHOT.jar org.example.Main*

*java -Dcom.sun.net.ssl.checkRevocation=false -cp
target/mymvnproj-1.0-SNAPSHOT.jar org.example.Main*

My code is below,

Repository repository = new URLRemoteRepository("
https://myhost:8443/jackrabbit-webapp-2.20.6/rmi",verify=False);
Session session = repository.login(new
SimpleCredentials("admin","admin".toCharArray()));

I am getting below exception.

javax.jcr.RepositoryException: Remote repository not found: The resource at
https:// myhost:8443/jackrabbit-webapp-2.20.6/rmi could not be retrieved:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.secur
ity.provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderE
xception: unable to find valid certification path to requested target
        at
org.apache.jackrabbit.rmi.repository.URLRemoteRepositoryFactory.getRemoteRepository(URLRemoteRepositoryFactory.java:84)
        at
org.apache.jackrabbit.rmi.repository.AbstractRemoteRepositoryFactory.getRepository(AbstractRemoteRepositoryFactory.java:59)
        at
org.apache.jackrabbit.commons.repository.ProxyRepository.getRepository(ProxyRepository.java:101)
        at
org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyRepository.java:198)
        at
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:144)
        at org.example.Main.main(Main.java:19)
Caused by: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested t
arget
        at sun.security.ssl.Alert.createSSLException(Unknown Source)
        at sun.security.ssl.TransportContext.fatal(Unknown Source)


Thanks
Praveen.

Reply via email to