I have a fresh installation of ubuntu 18.04. I'm having problems with my builds (e.g. Maven and Gradle) accessing a repository https, the message it shows is:
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
When I try to access the certificates from my keystore using the following command:
keytool -list -keystore /etc/ssl/certs/java/cacerts
I get prompted with a password, which is not a problem, but if I just press enter without inputting the password It does not show any of the entries.
If I put the password, all the certificates appear normally. What I had to do is add to all my Java applications the following system prop: javax.net.ssl.trustStorePassword=changeit
Then everything works normally. What I'm doing wrong?
EDIT:
This is the permission on the cacerts right now:
-rw-r--r-- 1 root root 167K jun 8 11:21 /etc/ssl/certs/java/cacerts
so everyone can read. If I try to use list without a password:
keytool -list -keystore /etc/ssl/certs/java/cacerts ✔ 308 10:27:15
Enter keystore password:
***************** WARNING WARNING WARNING *****************
* The integrity of the information stored in your keystore *
* has NOT been verified! In order to verify its integrity, *
* you must provide your keystore password. *
***************** WARNING WARNING WARNING *****************
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 0 entries
with the password:keytool -list -keystore /etc/ssl/certs/java/cacerts ✔ 310 10:36:33
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 134 entries