Android SSL - SNI 支持
我想了解 Android SDK 中对 SSL/TLS 服务器名称指示 (SNI) 扩展的支持。
I would like to know about the support for the SSL/TLS Server Name Indication (SNI) extension in the Android SDK.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,Android SDK中有部分支持。目前的情况如下:
HttpsURLConnection
API 支持 SNI。有一个 在 Android 错误跟踪器中针对此问题提出了请求。
还可以通过连接到以下 URL 来测试 SNI 支持:https://sni.velox.ch/
As far as I know, there is a partial support in Android SDK. The current situation is the following:
HttpsURLConnection
API supports SNI.There is an opened ticket regarding this issue in the Android bug tracker.
It is also possible to test the SNI support by making a connection to this URL: https://sni.velox.ch/
幸运的是, HttpsURLConnection 支持
SNI
自 Android 2.3 起。如果您需要支持Android 2.2(及更早版本)
,一种解决方法是在唯一端口上设置替代虚拟主机,以便明确返回哪个服务器证书。请查看此链接了解更多信息。希望这对未来的用户有所帮助。
Fortunately, HttpsURLConnection supports
SNI
sinceAndroid 2.3
. One workaround if you need to supportAndroid 2.2 (and older)
is to set up an alternative virtual host on a unique port so that it's unambiguous which server certificate to return.Please check this link for more information. Hope this will help future users.