Use host(name) to construct the SSLSocket

in XMPPTCPConnection.

So that the hostname and not the IP is available to the SSLSocket and
the SSLSession, which handed over to HostnameVerifier. This leaves the
HostnameVerifier with the

- name of the XMPP service (first argument of verify(String, SSLSession)
- name of the used host (found in the SSLSession)

allowing more complex verification mechanisms performed by the
HostnameVerifier.
This commit is contained in:
Florian Schmaus 2015-02-19 09:23:36 +01:00
parent 887c6114b7
commit 5f4374ec26
1 changed files with 1 additions and 1 deletions

View File

@ -721,7 +721,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
Socket plain = socket;
// Secure the plain connection
socket = context.getSocketFactory().createSocket(plain,
plain.getInetAddress().getHostAddress(), plain.getPort(), true);
host, plain.getPort(), true);
// Initialize the reader and writer with the new secured version
initReaderAndWriter();