Skip to content

Commit

Permalink
Fix XMPP code detection on s_client starttls xmpp
Browse files Browse the repository at this point in the history
 * Some XMPP Servers (OpenFire) use double quotes.
 * This makes s_client starttls work with this servers.
 * Tested with OpenFire servers from http://xmpp.net/ ::

     openssl s_client -connect coderollers.com:5222 -starttls xmpp
  • Loading branch information
clopez authored and benlaurie committed Sep 5, 2013
1 parent dece320 commit 4e48c77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/s_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,8 @@ SSL_set_tlsext_status_ids(con, ids);
"xmlns='jabber:client' to='%s' version='1.0'>", host);
seen = BIO_read(sbio,mbuf,BUFSIZZ);
mbuf[seen] = 0;
while (!strstr(mbuf, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'"))
while (!strstr(mbuf, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'") &&
!strstr(mbuf, "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\""))
{
if (strstr(mbuf, "/stream:features>"))
goto shut;
Expand Down

0 comments on commit 4e48c77

Please sign in to comment.