Imported Upstream version 1.4.10
This commit is contained in:
parent
6dd54dd8e2
commit
cff68b4c0a
203 changed files with 15026 additions and 8063 deletions
|
@ -5,7 +5,7 @@
|
|||
* License: GPL
|
||||
* Copyright (c) 2005 nagios-plugins team
|
||||
*
|
||||
* Last Modified: $Date: 2006/06/18 19:36:48 $
|
||||
* Last Modified: $Date: 2007-06-01 23:57:31 +0100 (Fri, 01 Jun 2007) $
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
|
@ -27,7 +27,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: sslutils.c,v 1.3 2006/06/18 19:36:48 opensides Exp $
|
||||
* $Id: sslutils.c 1726 2007-06-01 22:57:31Z hweiss $
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -38,15 +38,17 @@
|
|||
#ifdef HAVE_SSL
|
||||
static SSL_CTX *c=NULL;
|
||||
static SSL *s=NULL;
|
||||
static int initialized=0;
|
||||
|
||||
int np_net_ssl_init (int sd){
|
||||
SSL_METHOD *m=NULL;
|
||||
/* Initialize SSL context */
|
||||
SSLeay_add_ssl_algorithms ();
|
||||
m = SSLv23_client_method ();
|
||||
SSL_load_error_strings ();
|
||||
OpenSSL_add_all_algorithms();
|
||||
if ((c = SSL_CTX_new (m)) == NULL) {
|
||||
if (!initialized) {
|
||||
/* Initialize SSL context */
|
||||
SSLeay_add_ssl_algorithms ();
|
||||
SSL_load_error_strings ();
|
||||
OpenSSL_add_all_algorithms ();
|
||||
initialized = 1;
|
||||
}
|
||||
if ((c = SSL_CTX_new (SSLv23_client_method ())) == NULL) {
|
||||
printf ("%s\n", _("CRITICAL - Cannot create SSL context."));
|
||||
return STATE_CRITICAL;
|
||||
}
|
||||
|
@ -70,7 +72,11 @@ void np_net_ssl_cleanup (){
|
|||
if(s){
|
||||
SSL_shutdown (s);
|
||||
SSL_free (s);
|
||||
if(c) SSL_CTX_free (c);
|
||||
if(c) {
|
||||
SSL_CTX_free (c);
|
||||
c=NULL;
|
||||
}
|
||||
s=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue