开发者

HTTPSConnection figure out what underlying provider is being used

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;开发者_StackOverflow中文版

Thanks


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜