Reputation: 569
I am opening an HTTPSUrlConnection similar to the code below. I want to be sure that a certain provider is being used (the RSA one I loaded). How can I query the HTTPSUrlConnection to determine the provider being used?
URL url = new URL("https://myhost:8081/index.html");
URLConnection conn = url.openConnection();
HttpsURLConnection https_conn = (HttpsURLConnection) conn;
Thanks
Upvotes: 0
Views: 84
Reputation: 122769
If you want to use a specific security provider, build an SSLContext
with it using SSLContext.getInstance(protocol, provider)
(with a provider instance or name), then get an SSLSocketFactory
from this SSLContext
and then pass it to HttpsURLConnection.setSSLSocketFactory(...)
.
Upvotes: 1