Legacy Java code use of com.sun.net.ssl.internal.ssl.Provider()

java, legacy, provider, ssl

Solution

Throw that line of code away. Also throw away any reference to the `com.sun.net.ssl` package and its sub-packages: fix the imports so they refer to the classes in `javax.net.ssl.`

This is pre-JDK 1.4 code, from the days when JSSE was a separate download.

Problem

I am working with some code from back in 2003. There is a reference to the following class: ``` new com.sun.net.ssl.internal.ssl.Provider() ``` It is causing an error: `Access restriction: The type Provider is not accessible due to restriction on required library /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/jre/lib/jsse.jar` Does anyone have any suggestions for a suitable alternative to using this class?

Original source