summaryrefslogtreecommitdiffstats
path: root/third_party/libjingle/files/talk/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libjingle/files/talk/xmpp')
-rw-r--r--third_party/libjingle/files/talk/xmpp/plainsaslhandler.h10
-rw-r--r--third_party/libjingle/files/talk/xmpp/saslhandler.h9
-rw-r--r--third_party/libjingle/files/talk/xmpp/xmppclient.cc21
3 files changed, 25 insertions, 15 deletions
diff --git a/third_party/libjingle/files/talk/xmpp/plainsaslhandler.h b/third_party/libjingle/files/talk/xmpp/plainsaslhandler.h
index e7d44b9..39e4fb0 100644
--- a/third_party/libjingle/files/talk/xmpp/plainsaslhandler.h
+++ b/third_party/libjingle/files/talk/xmpp/plainsaslhandler.h
@@ -28,8 +28,10 @@
#ifndef _PLAINSASLHANDLER_H_
#define _PLAINSASLHANDLER_H_
-#include "talk/xmpp/saslhandler.h"
#include <algorithm>
+#include <string>
+
+#include "talk/xmpp/saslhandler.h"
namespace buzz {
@@ -66,6 +68,12 @@ public:
}
return NULL;
}
+
+ virtual bool GetTlsServerInfo(const talk_base::SocketAddress& server,
+ std::string* tls_server_hostname,
+ std::string* tls_server_domain) {
+ return false;
+ }
private:
Jid jid_;
diff --git a/third_party/libjingle/files/talk/xmpp/saslhandler.h b/third_party/libjingle/files/talk/xmpp/saslhandler.h
index 66386d5..739f6cc 100644
--- a/third_party/libjingle/files/talk/xmpp/saslhandler.h
+++ b/third_party/libjingle/files/talk/xmpp/saslhandler.h
@@ -31,6 +31,8 @@
#include <string>
#include <vector>
+#include "talk/base/socketaddress.h"
+
namespace buzz {
class XmlElement;
@@ -52,6 +54,13 @@ public:
// once you get it).
// If not handled, return NULL.
virtual SaslMechanism * CreateSaslMechanism(const std::string & mechanism) = 0;
+
+ // Fills in the tls server hostname/domain to use for the given
+ // server (and returns true). Return false if you want the defaults
+ // to be used.
+ virtual bool GetTlsServerInfo(const talk_base::SocketAddress& server,
+ std::string* tls_server_hostname,
+ std::string* tls_server_domain) = 0;
};
}
diff --git a/third_party/libjingle/files/talk/xmpp/xmppclient.cc b/third_party/libjingle/files/talk/xmpp/xmppclient.cc
index b0f3138..985f51e 100644
--- a/third_party/libjingle/files/talk/xmpp/xmppclient.cc
+++ b/third_party/libjingle/files/talk/xmpp/xmppclient.cc
@@ -116,20 +116,13 @@ XmppClient::Connect(const XmppClientSettings & settings,
}
d_->engine_->SetUseTls(settings.use_tls());
- //
- // The talk.google.com server expects you to use "gmail.com" in the
- // stream, and expects the domain certificate to be "gmail.com" as well.
- // For all other servers, we leave the strings empty, which causes
- // the jid's domain to be used. "foo@example.com" -> stream to="example.com"
- // tls certificate for "example.com"
- //
- // This is only true when using Gaia auth, so let's say if there's
- // no sasl_handler, we should use the actual server name
- // TODO(akalin): Do this in a less hackish way.
- if ((settings.server().IPAsString() == buzz::STR_TALK_GOOGLE_COM ||
- settings.server().IPAsString() == buzz::STR_TALKX_L_GOOGLE_COM) &&
- sasl_handler != NULL) {
- d_->engine_->SetTlsServer(buzz::STR_GMAIL_COM, buzz::STR_GMAIL_COM);
+ if (sasl_handler) {
+ std::string tls_server_hostname, tls_server_domain;
+ if (sasl_handler->GetTlsServerInfo(settings.server(),
+ &tls_server_hostname,
+ &tls_server_domain)) {
+ d_->engine_->SetTlsServer(tls_server_hostname, tls_server_domain);
+ }
}
// Set language