Module: kamailio
Branch: master
Commit: 2f0205093803cbd3761e6ae0384b548c19b4e3e4
URL:
https://github.com/kamailio/kamailio/commit/2f0205093803cbd3761e6ae0384b548…
Author: Hugh Waite <hugh.waite(a)xura.com>
Committer: Hugh Waite <hugh.waite(a)xura.com>
Date: 2016-02-02T10:15:22Z
curl: Ensure all values of verify_host are valid
- verify_host=1 is deprecated, automatically use 2
---
Modified: modules/curl/curlcon.c
Modified: modules/curl/functions.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2f0205093803cbd3761e6ae0384b548…
Patch:
https://github.com/kamailio/kamailio/commit/2f0205093803cbd3761e6ae0384b548…
---
diff --git a/modules/curl/curlcon.c b/modules/curl/curlcon.c
index 85a0142..5c947f5 100644
--- a/modules/curl/curlcon.c
+++ b/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) {
diff --git a/modules/curl/functions.c b/modules/curl/functions.c
index 1b530d6..754bbb3 100644
--- a/modules/curl/functions.c
+++ b/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);