summaryrefslogtreecommitdiffstats
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2004-11-18 22:42:17 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2004-11-18 22:42:17 (GMT)
commit43f7946598f062f80c2c92eb3757cb9a2c8ce1ec (patch)
tree4324f62904ef40701c1f9387a2326310209bb207 /plugins/check_tcp.c
parent20cb4595faa621d6736d7fc341dc3350c5f4c5e0 (diff)
downloadmonitoring-plugins-43f7946598f062f80c2c92eb3757cb9a2c8ce1ec.tar.gz
Enhance SSL initialization problems (Phil Dibowitz - 1055120)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@902 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r--plugins/check_tcp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 6f2aa03..126907f 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -529,8 +529,9 @@ connect_SSL (void)
529 529
530 /* Initialize SSL context */ 530 /* Initialize SSL context */
531 SSLeay_add_ssl_algorithms (); 531 SSLeay_add_ssl_algorithms ();
532 meth = SSLv2_client_method (); 532 meth = SSLv23_client_method ();
533 SSL_load_error_strings (); 533 SSL_load_error_strings ();
534 OpenSSL_add_all_algorithms();
534 if ((ctx = SSL_CTX_new (meth)) == NULL) 535 if ((ctx = SSL_CTX_new (meth)) == NULL)
535 { 536 {
536 printf (_("ERROR: Cannot create SSL context.\n")); 537 printf (_("ERROR: Cannot create SSL context.\n"));
@@ -553,7 +554,7 @@ connect_SSL (void)
553 if ((ssl = SSL_new (ctx)) != NULL) 554 if ((ssl = SSL_new (ctx)) != NULL)
554 { 555 {
555 SSL_set_fd (ssl, sd); 556 SSL_set_fd (ssl, sd);
556 if (SSL_connect (ssl) != -1) 557 if (SSL_connect(ssl) == 1)
557 return OK; 558 return OK;
558 ERR_print_errors_fp (stderr); 559 ERR_print_errors_fp (stderr);
559 } 560 }