1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

Rename 'serviceName' to 'xmppServiceDomain'

Also use 'null' as default value for the resource, to enforce server
generated resources.

Fixes Smack-665
This commit is contained in:
Florian Schmaus 2015-05-18 16:48:23 +02:00
parent 0c8199650b
commit f369a009ac
38 changed files with 116 additions and 104 deletions

View file

@ -711,8 +711,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
final HostnameVerifier verifier = getConfiguration().getHostnameVerifier();
if (verifier == null) {
throw new IllegalStateException("No HostnameVerifier set. Use connectionConfiguration.setHostnameVerifier() to configure.");
} else if (!verifier.verify(getServiceName().toString(), sslSocket.getSession())) {
throw new CertificateException("Hostname verification of certificate failed. Certificate does not authenticate " + getServiceName());
} else if (!verifier.verify(getXMPPServiceDomain().toString(), sslSocket.getSession())) {
throw new CertificateException("Hostname verification of certificate failed. Certificate does not authenticate " + getXMPPServiceDomain());
}
// Set that TLS was successful
@ -875,7 +875,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
// possible. The 'to' attribute is *always* available. The 'from' attribute if set by the user and no external
// mechanism is used to determine the local entity (user). And the 'id' attribute is available after the first
// response from the server (see e.g. RFC 6120 § 9.1.1 Step 2.)
CharSequence to = getServiceName();
CharSequence to = getXMPPServiceDomain();
CharSequence from = null;
CharSequence localpart = config.getUsername();
if (localpart != null) {
@ -945,8 +945,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
// We found an opening stream.
if ("jabber:client".equals(parser.getNamespace(null))) {
streamId = parser.getAttributeValue("", "id");
String reportedServiceName = parser.getAttributeValue("", "from");
assert(config.getServiceName().equals(reportedServiceName));
String reportedServerDomain = parser.getAttributeValue("", "from");
assert(config.getXMPPServiceDomain().equals(reportedServerDomain));
}
break;
case "error":