summaryrefslogtreecommitdiff
path: root/net-analyzer/monitoring-plugins/files/monitoring-plugins-gnutls.patch
blob: 00415f0b7111033189a20f1217ccecea0ada5da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
https://bugs.gentoo.org/880211
https://github.com/monitoring-plugins/monitoring-plugins/issues/1834
https://github.com/monitoring-plugins/monitoring-plugins/commit/31bdbfce92de2dc7717fe13a8d1ca8e7dbf850d4

diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index 286273f6..c26c4fb3 100644
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
@@ -134,7 +134,12 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
 		return STATE_CRITICAL;
 	}
 	if (cert && privkey) {
+#ifdef USE_GNUTLS
+		SSL_CTX_use_certificate_file(c, cert, SSL_FILETYPE_PEM);
+#endif
+#ifdef USE_OPENSSL
 		SSL_CTX_use_certificate_chain_file(c, cert);
+#endif
 		SSL_CTX_use_PrivateKey_file(c, privkey, SSL_FILETYPE_PEM);
 #ifdef USE_OPENSSL
 		if (!SSL_CTX_check_private_key(c)) {