1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 03:52:06 +01:00

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

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