diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-06-11 22:02:26 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-06-11 22:02:26 (GMT) |
commit | 083952c426a250eaf6810b3b22e7555e4aeb3f2d (patch) | |
tree | fa1aa3bc3b9d59f59debcd9b006dc1bde6d87ed8 | |
parent | 1b3890572ed5c19ce51634c1a071c0a24eb61ddf (diff) | |
download | monitoring-plugins-083952c426a250eaf6810b3b22e7555e4aeb3f2d.tar.gz |
Fix compilation with GnuTLS
GnuTLS doesn't provide a SSL_CTX_check_private_key() function.
Closes #1254.
-rw-r--r-- | plugins/sslutils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/sslutils.c b/plugins/sslutils.c index 2732125..687bffb 100644 --- a/plugins/sslutils.c +++ b/plugins/sslutils.c | |||
@@ -86,10 +86,12 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int | |||
86 | if (cert && privkey) { | 86 | if (cert && privkey) { |
87 | SSL_CTX_use_certificate_file(c, cert, SSL_FILETYPE_PEM); | 87 | SSL_CTX_use_certificate_file(c, cert, SSL_FILETYPE_PEM); |
88 | SSL_CTX_use_PrivateKey_file(c, privkey, SSL_FILETYPE_PEM); | 88 | SSL_CTX_use_PrivateKey_file(c, privkey, SSL_FILETYPE_PEM); |
89 | #ifdef USE_OPENSSL | ||
89 | if (!SSL_CTX_check_private_key(c)) { | 90 | if (!SSL_CTX_check_private_key(c)) { |
90 | printf ("%s\n", _("CRITICAL - Private key does not seem to match certificate!\n")); | 91 | printf ("%s\n", _("CRITICAL - Private key does not seem to match certificate!\n")); |
91 | return STATE_CRITICAL; | 92 | return STATE_CRITICAL; |
92 | } | 93 | } |
94 | #endif | ||
93 | } | 95 | } |
94 | #ifdef SSL_OP_NO_TICKET | 96 | #ifdef SSL_OP_NO_TICKET |
95 | SSL_CTX_set_options(c, SSL_OP_NO_TICKET); | 97 | SSL_CTX_set_options(c, SSL_OP_NO_TICKET); |