Don't allow -www etc options with DTLS.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 15 Jul 2014 11:22:49 +0000 (12:22 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 15 Jul 2014 11:25:39 +0000 (12:25 +0100)
The options which emulate a web server don't make sense when doing DTLS.
Exit with an error if an attempt is made to use them.

PR#3453
(cherry picked from commit 58a2aaeade8bdecd0f9f0df41927f7cff3012547)

apps/s_server.c

index a399d57a0582d4d01d7845c7fce31c2055a30c0e..fe7ad8823207c911470e2a00bac3e254cedf6843 100644 (file)
@@ -1362,6 +1362,14 @@ bad:
                sv_usage();
                goto end;
                }
+#ifndef OPENSSL_NO_DTLS1
+       if (www && socket_type == SOCK_DGRAM)
+               {
+               BIO_printf(bio_err,
+                               "Can't use -HTTP, -www or -WWW with DTLS\n");
+               goto end;
+               }
+#endif
 
 #if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK)
        if (jpake_secret)