Feature request: SNI support


it would be nice to add SNI (server name indication, http://http://en.wikipedia.org/wiki/Server_Name_Indication) support to Smack library.

Not all of implementations of SSLSocket support SNI by default, especially in older versions of android (these with Apache HTTP client library).

There is simple fix of this by setting the value of hostName to SSLSocket (if not present) by reflection:

java.lang.reflect.Method setHostnameMethod = sslSocket.getClass().getMethod("setHostname", String.class)
setHostnameMethod.invoke(sslSocket, host);

Thanks for thinking about this.

Tomas N.

Thanks for your feature request. I’m curious what your use case for SNI in XMPP would be. As RFC 7590 - Use of Transport Layer Security (TLS) in the Extensible Messaging and Presence Protocol (XMPP) § 3.5 states, there is usually no need for it in XMPP (with the exception of XEP-0368).

As in XEP-0368, chapter Use cases: *“For server operators, this provides a way to host multiple services on the same port, especially when SNI or ALPN extensions are used.”, *this is exactly my use case.

I need to run multiple services on the same address and port (one of them is XMPP server).

But you can’t do so without SNI as the open also contains that information. If you don’t do TLS right away, which is about XEP-368 is about.