瀏覽代碼

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

madlohe 6 年之前
父節點
當前提交
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)
         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 (host_name == NULL)
             usage4 (_("You must specify a server address or host name"));