summaryrefslogtreecommitdiffstats
path: root/plugins/sslutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sslutils.c')
-rw-r--r--plugins/sslutils.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index a7d8019..666a012 100644
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
@@ -200,17 +200,6 @@ int np_net_ssl_read(void *buf, int num) {
200 return SSL_read(s, buf, num); 200 return SSL_read(s, buf, num);
201} 201}
202 202
203int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
204# ifdef USE_OPENSSL
205 X509 *certificate = NULL;
206 certificate=SSL_get_peer_certificate(s);
207 return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit));
208# else /* ifndef USE_OPENSSL */
209 printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
210 return STATE_WARNING;
211# endif /* USE_OPENSSL */
212}
213
214int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){ 203int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){
215# ifdef USE_OPENSSL 204# ifdef USE_OPENSSL
216 X509_NAME *subj=NULL; 205 X509_NAME *subj=NULL;
@@ -337,4 +326,16 @@ int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int
337# endif /* USE_OPENSSL */ 326# endif /* USE_OPENSSL */
338} 327}
339 328
329int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
330# ifdef USE_OPENSSL
331 X509 *certificate = NULL;
332 certificate=SSL_get_peer_certificate(s);
333 return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit));
334# else /* ifndef USE_OPENSSL */
335 printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
336 return STATE_WARNING;
337# endif /* USE_OPENSSL */
338}
339
340
340#endif /* HAVE_SSL */ 341#endif /* HAVE_SSL */