In Java 11 the default keystore was updated from JKS
to
PKCS12.
As a result, applications relying on
KeyStore.getDefaultType() may encounter issues after
migrating, unless their JKS keystore has been converted to PKCS12.
This rule identifies and flags the use of the
KeyStore.getDefaultType() method.
If developers need to maintain compatibility with JKS, they can manually specify the keystore type as
"jks" in their applications.
For example consider the following code snippet:
Instead of relying on the default keystore type value returned by
KeyStore.getDefaultType(), in Java11 users can explicitely
specify "jks" like this:
This rule has an automated fix that returns
"jks" when
KeyStore.getDefaultType()method is called.
Copy the custom configuration to your application build file to enable the fix automation.
For more information, see the following resources: