From e86b06ba2cbf8779fa92b9b76c4229e15d173185 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 6 Jan 2017 19:47:36 +0100 Subject: added an --insecure switch for SSL connections with self-signed certificates --- src/check_curl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/check_curl.c') diff --git a/src/check_curl.c b/src/check_curl.c index c014359..bbb8d12 100644 --- a/src/check_curl.c +++ b/src/check_curl.c @@ -202,6 +202,12 @@ int main( int argc, char *argv[] ) { curl_easy_setopt( curl, CURLOPT_SSL_VERIFYHOST, 0 ); } + /* --insecure: allow SSL connections totally insecurely (for self-signed certificates) */ + if( args_info.insecure_given ) { + curl_easy_setopt( curl, CURLOPT_SSL_VERIFYPEER, 0 ); + curl_easy_setopt( curl, CURLOPT_SSL_VERIFYHOST, 0 ); + } + /* --cert: client certificate to present to server (SSL) */ if( args_info.cert_given ) { curl_easy_setopt( curl, CURLOPT_SSLCERT, args_info.cert_arg ); -- cgit v1.2.3-54-g00ecf