VMware {code} Community
NewtoVCentre
Contributor
Contributor
Jump to solution

InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Hi,

I am a newbie to vSphere Web Services SDK.

I am trying to execute the SimpleClient.java program from the sample programs given along with the SDK.

I have set all the required variables (JAVAHOME, AXISHOME, WBEMHOME, VMKEYSTORE). I had also executed the code on friday and it worked.

After which I had turned off my machine.

Today morning when I started working on the same code to try to execute it, its giving me an exception as below:

" Caught Exception : Exception : org.apache.axis.AxisFault Message : ; nested exception is:

javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty"

The way I am executing my code is as below:

$ ./run.sh com.vmware.samples.general.SimpleClient --url <IP>:8443/sdk --username <username> --password <password>

I am absolutely stuck up in this and am not able to understand the reason for tis exception.

Please help me with this.

thanks a lot in advance.

0 Kudos
1 Solution

Accepted Solutions
jeveenj
Enthusiast
Enthusiast
Jump to solution

Hi

Please refer to Developer's setup guide page no 16 & 17.

By using - -ignorecert, you can ignore the server-certificate verification.

run.bat com.vmware.samples.general.SimpleClient --url https://<IP>:8443/sdk --username <username> --password <password> --ignorecert

Hope this Helps.

-If you found this information useful, please consider awarding points for Correct or Helpful.

View solution in original post

0 Kudos
4 Replies
jeveenj
Enthusiast
Enthusiast
Jump to solution

Hi

Please refer to Developer's setup guide page no 16 & 17.

By using - -ignorecert, you can ignore the server-certificate verification.

run.bat com.vmware.samples.general.SimpleClient --url https://<IP>:8443/sdk --username <username> --password <password> --ignorecert

Hope this Helps.

-If you found this information useful, please consider awarding points for Correct or Helpful.
0 Kudos
NewtoVCentre
Contributor
Contributor
Jump to solution

Hi Jeevan,

Fristly thanks a lot,. Yes this surely did help. i was able to run the code now.

But i am yet I am curious, as to, this same program executed once without the --ignorecert parameter and then the next day it didnt.

What's the reason for this strange behaviour? Do you have any idea about it??

If you do have, please do let me know.

Thanks a lot again.

0 Kudos
jeveenj
Enthusiast
Enthusiast
Jump to solution

Hi,

It might be possible, that you were initially connecting to the server via http in “–url http://<>; “ .

Http will not check the certificate (provided you have enabled the ESX for http) and execute correctly. But with https, it checks for certificates.

-If you found this information useful, please consider awarding points for Correct or Helpful.
0 Kudos
NewtoVCentre
Contributor
Contributor
Jump to solution

Hi,

No i wan't using --url http. I am damn sure i was using --url https and the code worked for the first time.

Probably after I shut down the system, something went wrong wrt the certificates (thats my gut feeling).

I just want to understand what that somethng is, so that when stuck into similar situation next time,

I know the root cause of the problem and am able to solve it then.

0 Kudos