]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ssl: register probing for port 443 if no config
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 10 Jul 2019 19:02:09 +0000 (21:02 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 19 Jul 2019 14:09:37 +0000 (16:09 +0200)
src/app-layer-ssl.c

index ea384c8d1eb1619e1838177670c40540666d188b..0adc077d866fed49bdb407cf5941f48c81750b69 100644 (file)
@@ -2853,10 +2853,20 @@ void RegisterSSLParsers(void)
                                           STREAM_TOSERVER,
                                           SSLProbingParser, NULL);
         } else {
-            AppLayerProtoDetectPPParseConfPorts("tcp", IPPROTO_TCP,
-                                                proto_name, ALPROTO_TLS,
-                                                0, 3,
-                                                SSLProbingParser, NULL);
+            if (AppLayerProtoDetectPPParseConfPorts("tcp", IPPROTO_TCP,
+                                                    proto_name, ALPROTO_TLS,
+                                                    0, 3,
+                                                    SSLProbingParser, NULL) == 0) {
+                SCLogWarning(SC_ERR_MISSING_CONFIG_PARAM,
+                             "no TLS config found, "
+                             "enabling TLS detection on port 443.");
+                AppLayerProtoDetectPPRegister(IPPROTO_TCP,
+                                              "443",
+                                              ALPROTO_TLS,
+                                              0, 3,
+                                              STREAM_TOSERVER,
+                                              SSLProbingParser, NULL);
+            }
         }
     } else {
         SCLogInfo("Protocol detection and parser disabled for %s protocol",