* Many XMPP servers are configured with multiple domains (virtual hosts)
* In order to establish successfully the TLS connection you have to specify
which virtual host you are trying to connect.
* Test this, for example with ::
* Fail:
openssl s_client -connect talk.google.com:5222 -starttls xmpp
* Works:
openssl s_client -connect talk.google.com:5222 -starttls xmpp -xmpphost
gmail.com
---
apps/s_client.c | 8 +++++++-
doc/apps/s_client.pod | 8 ++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/apps/s_client.c b/apps/s_client.c
index 982794c..40a5efe 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -572,6 +572,7 @@ int MAIN(int argc, char **argv)
short port=PORT;
int full_log=1;
char *host=SSL_HOST_NAME;
+ char *xmpphost = NULL;
char *cert_file=NULL,*key_file=NULL;
int cert_format = FORMAT_PEM, key_format = FORMAT_PEM;
char *passarg = NULL, *pass = NULL;
@@ -683,6 +684,11 @@ int MAIN(int argc, char **argv)
if (!extract_host_port(*(++argv),&host,NULL,&port))
goto bad;
}
+ else if (strcmp(*argv,"-xmpphost") == 0)
+ {
+ if (--argc < 1) goto bad;
+ xmpphost= *(++argv);
+ }
else if (strcmp(*argv,"-verify") == 0)
{
verify=SSL_VERIFY_PEER;
@@ -1548,7 +1554,7 @@ SSL_set_tlsext_status_ids(con, ids);
int seen = 0;
BIO_printf(sbio,"<stream:stream "
"xmlns:stream='http://etherx.jabber.org/streams' "
- "xmlns='jabber:client' to='%s' version='1.0'>", host);
+ "xmlns='jabber:client' to='%s' version='1.0'>", xmpphost?
xmpphost:host);
seen = BIO_read(sbio,mbuf,BUFSIZZ);
mbuf[seen] = 0;
while (!strstr(mbuf, "<starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'") &&
diff --git a/doc/apps/s_client.pod b/doc/apps/s_client.pod
index 7849c3e..2489cf5 100644
--- a/doc/apps/s_client.pod
+++ b/doc/apps/s_client.pod
@@ -37,6 +37,7 @@ B<openssl> B<s_client>
[B<-bugs>]
[B<-cipher cipherlist>]
[B<-starttls protocol>]
+[B<-xmpphost hostname>]
[B<-engine id>]
[B<-tlsextdebug>]
[B<-no_ticket>]
@@ -205,6 +206,13 @@ send the protocol-specific message(s) to switch to TLS for
communication.
B<protocol> is a keyword for the intended protocol. Currently, the only
supported keywords are "smtp", "pop3", "imap", "ftp" and "xmpp".
+=item B<-xmpphost hostname>
+
+This option, when used with "-starttls xmpp", specifies the host for the
+"to" attribute of the stream element.
+If this option is not specified, then the host specified with "-connect"
+will be used.
+
=item B<-tlsextdebug>
print out a hex dump of any TLS extensions received from the server.
--
1.7.10.4
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]