Java SNIServerName support in Java 7

青春壹個敷衍的年華 提交于 2019-12-13 18:08:52

问题


As per Wikipedia, Java 1.7 should support SNIServerName, but as per Java docs there is no such class in their javax.net.ssl package.Can someone please clarify this? Will I have to use Java 8 API to use SNIServerName class?


回答1:


The support is there, see https://docs.oracle.com/javase/7/docs/technotes/guides/security/enhancements-7.html:

Server Name Indication (SNI) for JSSE client: The Java SE 7 release supports the Server Name Indication (SNI) extension in the JSSE client. SNI is described in RFC 4366. This enables TLS clients to connect to virtual servers.

However, it is implemented in a different way. For example https://issues.apache.org/jira/browse/HTTPCLIENT-1119 discusses this. The relevant quote might be

Java 8 has a completely different SNI API provided out of javax.net.ssl package

So yes, you won't have that class with Java 7, and you will "have to use Java 8 API to use SNIServerName class", like you asked.

For discussion on how to use SNI with Java 7, see this thread.



来源:https://stackoverflow.com/questions/41829133/java-sniservername-support-in-java-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!