[monitoring-plugins] sslutils.c: Move function after a function it ...
RincewindsHat
git at monitoring-plugins.org
Fri Feb 10 11:50:13 CET 2023
Module: monitoring-plugins
Branch: master
Commit: c4704e163ebf54277ff901f06f09126ef3a3bc7f
Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
Date: Thu Feb 2 12:03:44 2023 +0100
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=c4704e1
sslutils.c: Move function after a function it uses to avoid forward declarations
---
plugins/sslutils.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index 286273f..4f12dda 100644
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
@@ -191,17 +191,6 @@ int np_net_ssl_read(void *buf, int num) {
return SSL_read(s, buf, num);
}
-int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
-# ifdef USE_OPENSSL
- X509 *certificate = NULL;
- certificate=SSL_get_peer_certificate(s);
- return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit));
-# else /* ifndef USE_OPENSSL */
- printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
- return STATE_WARNING;
-# endif /* USE_OPENSSL */
-}
-
int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){
# ifdef USE_OPENSSL
X509_NAME *subj=NULL;
@@ -328,4 +317,16 @@ int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int
# endif /* USE_OPENSSL */
}
+int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
+# ifdef USE_OPENSSL
+ X509 *certificate = NULL;
+ certificate=SSL_get_peer_certificate(s);
+ return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit));
+# else /* ifndef USE_OPENSSL */
+ printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
+ return STATE_WARNING;
+# endif /* USE_OPENSSL */
+}
+
+
#endif /* HAVE_SSL */
More information about the Commits
mailing list