summaryrefslogtreecommitdiffstats
path: root/nanohttp
diff options
context:
space:
mode:
authorGravatar mrcsys2006-01-18 14:53:13 +0000
committerGravatar mrcsys2006-01-18 14:53:13 +0000
commitdf494ade428ddb4cb6a9a6f8b3885cf1b2478f06 (patch)
treefa3065731f8c087efbd03e2c8fdcf63bbd19b21d /nanohttp
parent4088eae7d38124978cf01eaf4bfe2d6aab3a42fd (diff)
downloadcsoap-df494ade428ddb4cb6a9a6f8b3885cf1b2478f06.tar.gz
csoap-df494ade428ddb4cb6a9a6f8b3885cf1b2478f06.tar.bz2
Added start_ssl function to initialize library.
Diffstat (limited to 'nanohttp')
-rw-r--r--nanohttp/nanohttp-client.c5
-rw-r--r--nanohttp/nanohttp-server.c6
-rw-r--r--nanohttp/nanohttp-ssl.c20
-rw-r--r--nanohttp/nanohttp-ssl.h4
4 files changed, 24 insertions, 11 deletions
diff --git a/nanohttp/nanohttp-client.c b/nanohttp/nanohttp-client.c
index e61e5af..6f7d864 100644
--- a/nanohttp/nanohttp-client.c
+++ b/nanohttp/nanohttp-client.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-client.c,v 1.33 2006/01/10 11:29:05 snowdrop Exp $
+* $Id: nanohttp-client.c,v 1.34 2006/01/18 14:53:13 mrcsys Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -55,6 +55,9 @@ httpc_init(int argc, char *argv[])
{
hoption_init_args(argc, argv);
hsocket_module_init();
+#ifdef HAVE_SSL
+ start_ssl();
+#endif
return H_OK;
}
diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c
index cc5517b..2da65b7 100644
--- a/nanohttp/nanohttp-server.c
+++ b/nanohttp/nanohttp-server.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-server.c,v 1.43 2006/01/11 10:54:43 snowdrop Exp $
+* $Id: nanohttp-server.c,v 1.44 2006/01/18 14:53:13 mrcsys Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -167,6 +167,10 @@ httpd_init (int argc, char *argv[])
*/
#endif
+#ifdef HAVE_SSL
+ start_ssl();
+#endif
+
/* create socket */
status = hsocket_init (&_httpd_socket);
if (status != H_OK)
diff --git a/nanohttp/nanohttp-ssl.c b/nanohttp/nanohttp-ssl.c
index 254b718..a2cdf17 100644
--- a/nanohttp/nanohttp-ssl.c
+++ b/nanohttp/nanohttp-ssl.c
@@ -166,22 +166,24 @@ user_verify (X509 * cert)
}
#endif
-SSL_CTX *
-initialize_ctx (const char *keyfile, const char *password, const char *calist)
-{
- SSL_CTX *ctx = NULL;
-
- if (password == NULL)
- password = "";
-
-
+void
+start_ssl( void ){
/* Global system initialization */
log_verbose1 ("Initializing library");
SSL_library_init ();
SSL_load_error_strings ();
ERR_load_crypto_strings ();
OpenSSL_add_ssl_algorithms ();
+}
+SSL_CTX *
+initialize_ctx (const char *keyfile, const char *password, const char *calist)
+{
+ SSL_CTX *ctx = NULL;
+
+ if (password == NULL)
+ password = "";
+
/* Create our context */
ctx = SSL_CTX_new (SSLv23_method ());
diff --git a/nanohttp/nanohttp-ssl.h b/nanohttp/nanohttp-ssl.h
index 5cb4cc3..aa035d6 100644
--- a/nanohttp/nanohttp-ssl.h
+++ b/nanohttp/nanohttp-ssl.h
@@ -60,6 +60,10 @@ typedef struct Con
//static int pw_cb(char* buf, int num, int rwflag, void *userdata);
/*
+ * Start the ssl library
+ */
+void start_ssl( void );
+/*
* Initialize the context
*/