diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-01-06 19:47:36 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-01-06 19:47:36 +0100 |
commit | e86b06ba2cbf8779fa92b9b76c4229e15d173185 (patch) | |
tree | 2d375e227eccb5ae3133dde6ffdef2654d2c5460 /src/check_curl.c | |
parent | adda452d76f9b1ed04229d85ca43164102d4405d (diff) | |
download | nagios-plugin-curl-e86b06ba2cbf8779fa92b9b76c4229e15d173185.tar.gz nagios-plugin-curl-e86b06ba2cbf8779fa92b9b76c4229e15d173185.tar.bz2 |
added an --insecure switch for SSL connections with self-signed certificates
Diffstat (limited to 'src/check_curl.c')
-rw-r--r-- | src/check_curl.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 ); |