a1fb602
diff -up openssl-1.0.2a/apps/s_client.c.starttls openssl-1.0.2a/apps/s_client.c
a1fb602
--- openssl-1.0.2a/apps/s_client.c.starttls	2015-04-22 18:23:12.964387157 +0200
a1fb602
+++ openssl-1.0.2a/apps/s_client.c	2015-04-22 18:23:56.496414820 +0200
a1fb602
@@ -134,7 +134,8 @@
a1fb602
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
a1fb602
  * OTHERWISE.
a1fb602
  */
a1fb602
-
a1fb602
+/* for strcasestr */
a1fb602
+#define _GNU_SOURCE
a1fb602
 #include <assert.h>
a1fb602
 #include <ctype.h>
a1fb602
 #include <stdio.h>
a1fb602
@@ -1626,8 +1627,11 @@ int MAIN(int argc, char **argv)
a1fb602
                    "xmlns='jabber:client' to='%s' version='1.0'>", host);
a1fb602
         seen = BIO_read(sbio, mbuf, BUFSIZZ);
a1fb602
         mbuf[seen] = 0;
a1fb602
-        while (!strstr
a1fb602
-               (mbuf, "
a1fb602
+        while (!strcasestr
a1fb602
+               (mbuf, "
a1fb602
+               && !strcasestr(mbuf,
a1fb602
+                              "
a1fb602
+        {
a1fb602
             if (strstr(mbuf, "/stream:features>"))
a1fb602
                 goto shut;
a1fb602
             seen = BIO_read(sbio, mbuf, BUFSIZZ);