tags:

views:

31

answers:

1

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

+1  A: 

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(...).

Bruno