Ver código fonte

curl: Ensure all values of verify_host are valid
- verify_host=1 is deprecated, automatically use 2

Hugh Waite 9 anos atrás
pai
commit
2f02050938
2 arquivos alterados com 1 adições e 5 exclusões
  1. 0 4
      modules/curl/curlcon.c
  2. 1 1
      modules/curl/functions.c

+ 0 - 4
modules/curl/curlcon.c

@@ -326,10 +326,6 @@ int curl_parse_param(char *val)
 					LM_DBG("curl connection [%.*s]: verifyhost bad value. Using default\n", name.len, name.s);
 					verify_host = default_tls_verify_host;
 				}
-				if (verify_host != 0 && verify_host != 1) {
-					LM_DBG("curl connection [%.*s]: verifyhost bad value. Using default\n", name.len, name.s);
-					verify_host = default_tls_verify_host;
-				}
 				LM_DBG("curl [%.*s] - verifyhost [%d]\n", pit->name.len, pit->name.s, verify_host);
 			} else if(pit->name.len==10 && strncmp(pit->name.s, "sslversion", 10)==0) {
 				if(str2int(&tok, &sslversion)!=0) {

+ 1 - 1
modules/curl/functions.c

@@ -181,7 +181,7 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, const
     }
 
     res |= curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long) params->verify_peer);
-    res |= curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long) params->verify_host);
+    res |= curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long) params->verify_host?2:0);
 
     res |= curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long) 1);
     res |= curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long) params->timeout);