Просмотр исходного кода

check_http: cause plugin to fail early if SNI is specified without a hostname

madlohe 6 лет назад
Родитель
Сommit
29295c81f3
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      plugins/check_http.c

+ 4 - 0
plugins/check_http.c

@@ -577,6 +577,10 @@ enable_ssl:
     if (host_name == NULL && c < argc)
     if (host_name == NULL && c < argc)
         host_name = strdup (argv[c++]);
         host_name = strdup (argv[c++]);
 
 
+    if (use_sni && host_name == NULL) {
+        usage4(_("Server name indication requires that a host name is defined with -H"));
+    }
+
     if (server_address == NULL) {
     if (server_address == NULL) {
         if (host_name == NULL)
         if (host_name == NULL)
             usage4 (_("You must specify a server address or host name"));
             usage4 (_("You must specify a server address or host name"));