Do not use APIs from com.sun.net.ssl packages

The classes and interfaces in the com.sun.net.ssl package are deprecated and replaced by classes and interfaces in the javax.net.ssl package.

The automated fix changes references to the com.sun.net.ssl package to javax.net.ssl . Copy the custom configuration to your application build file to enable the fix automation. The rule will detect fully qualified names in import statements and in the body of the Java code.

For example, code fragments such as

import com.sun.net.ssl.X509KeyManager;
    
if (keyManager instanceof com.sun.net.ssl.X509KeyManager)

are changed to

import javax.net.ssl.X509KeyManager;
    
if (keyManager instanceof javax.net.ssl.X509KeyManager)

The automated fix changes package imports such as

import com.sun.net.ssl.*;

to

import javax.net.ssl.*;

After applying the automated fixes for this rule, you may still have a number of changes to make depending on which APIs you use and how you use them. Use the Eclipse Java problem markers to help you work through additional changes needed because of the differences between the com.sun.net.ssl APIs and the javax.net.ssl APIs. Some examples of the differences include:

For additional information related to this rule, see: