InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Problem Statement: Getting exception while trying to connecting remote https system.

Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
	at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:103)
	at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:87)
	at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:57)
	... 28 common frames omitted

Solution: System is not getting keystore from relative path.
Provide absolutepath and keystore name. It should be resolved.

//System.setProperty("javax.net.ssl.trustStore", relativePath+key_name); //Not working

System.setProperty("javax.net.ssl.trustStore", absolutePath+key_name); //Working

-o-

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s