Setting the provider in the security object can be done statically in the security properties file (jre\lib\security\java.security).
To set this provider statically, find the following line in the security properties file:
security.provider.1=sun.security.provider.Sun
Add the following line immediately after:
security.provider.x=com.sun.net.ssl.internal.ssl.Provider
where x is equal to the next sequential number (for example, security.provider.2=com.sun.net.ssl.internal.ssl.Provider).
IMPORTANT: Both of these lines are required in order for SSL to work correctly.