Module: monitoring-plugins
 Branch: master
 Commit: 083952c426a250eaf6810b3b22e7555e4aeb3f2d
 Author: Holger Weiss <[email protected]>
   Date: Thu Jun 12 00:02:26 2014 +0200
    URL: 
https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=083952c

Fix compilation with GnuTLS

GnuTLS doesn't provide a SSL_CTX_check_private_key() function.

Closes #1254.

---

 plugins/sslutils.c | 2 ++
 1 file changed, 2 insertions(+)

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
        if (cert && privkey) {
                SSL_CTX_use_certificate_file(c, cert, SSL_FILETYPE_PEM);
                SSL_CTX_use_PrivateKey_file(c, privkey, SSL_FILETYPE_PEM);
+#ifdef USE_OPENSSL
                if (!SSL_CTX_check_private_key(c)) {
                        printf ("%s\n", _("CRITICAL - Private key does not seem 
to match certificate!\n"));
                        return STATE_CRITICAL;
                }
+#endif
        }
 #ifdef SSL_OP_NO_TICKET
        SSL_CTX_set_options(c, SSL_OP_NO_TICKET);

Reply via email to