mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-09 08:42:17 -04:00
fallback to SSL_CTX_use_certificate_file for gnutls
This commit is contained in:
parent
fc8a233854
commit
6f0ce3804a
1 changed files with 12 additions and 1 deletions
|
|
@ -134,7 +134,18 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
|
|||
return STATE_CRITICAL;
|
||||
}
|
||||
if (cert && privkey) {
|
||||
SSL_CTX_use_certificate_chain_file(c, cert);
|
||||
#ifdef USE_OPENSSL
|
||||
if (!SSL_CTX_use_certificate_chain_file(c, cert)) {
|
||||
#else
|
||||
#if USE_GNUTLS
|
||||
if (!SSL_CTX_use_certificate_file(c, cert, SSL_FILETYPE_PEM)) {
|
||||
#else
|
||||
#error Unported for unknown SSL library
|
||||
#endif
|
||||
#endif
|
||||
printf ("%s\n", _("CRITICAL - Unable to open certificate chain file!\n"));
|
||||
return STATE_CRITICAL;
|
||||
}
|
||||
SSL_CTX_use_PrivateKey_file(c, privkey, SSL_FILETYPE_PEM);
|
||||
#ifdef USE_OPENSSL
|
||||
if (!SSL_CTX_check_private_key(c)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue