Browse code

ruxc: added http_tlsmode parameter

- if set to 1, it connects only to trusted https websites
- default 0 - accept all certificates

Daniel-Constantin Mierla authored on 21/07/2021 14:22:42
Showing 1 changed files
... ...
@@ -39,6 +39,7 @@
39 39
 MODULE_VERSION
40 40
 
41 41
 static int _ruxc_http_timeout = 5000;
42
+static int _ruxc_http_tlsmode = 0;
42 43
 
43 44
 static int mod_init(void);
44 45
 static int child_init(int);
... ...
@@ -71,6 +72,7 @@ static cmd_export_t cmds[]={
71 72
 
72 73
 static param_export_t params[]={
73 74
 	{"http_timeout",       PARAM_INT,   &_ruxc_http_timeout},
75
+	{"http_tlsmode",       PARAM_INT,   &_ruxc_http_tlsmode},
74 76
 
75 77
 	{0, 0, 0}
76 78
 };
... ...
@@ -129,6 +131,7 @@ static int ki_ruxc_http_get_helper(sip_msg_t *_msg, str *url, str *hdrs,
129 131
     v_http_request.timeout_connect = _ruxc_http_timeout;
130 132
     v_http_request.timeout_read = _ruxc_http_timeout;
131 133
     v_http_request.timeout_write = _ruxc_http_timeout;
134
+	v_http_request.tlsmode = _ruxc_http_tlsmode;
132 135
 
133 136
 	v_http_request.url = url->s;
134 137
 	v_http_request.url_len = url->len;
... ...
@@ -225,6 +228,7 @@ static int ki_ruxc_http_post_helper(sip_msg_t *_msg, str *url, str *body, str *h
225 228
     v_http_request.timeout_connect = _ruxc_http_timeout;
226 229
     v_http_request.timeout_read = _ruxc_http_timeout;
227 230
     v_http_request.timeout_write = _ruxc_http_timeout;
231
+	v_http_request.tlsmode = _ruxc_http_tlsmode;
228 232
 
229 233
 	v_http_request.url = url->s;
230 234
 	v_http_request.url_len = url->len;