summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-ssl.c
diff options
context:
space:
mode:
authorGravatar m0gg2006-12-01 10:55:59 +0000
committerGravatar m0gg2006-12-01 10:55:59 +0000
commit1e0e97fe7b654ecd7f5315d129df6e57f3e63371 (patch)
treedce178f3f876c04f4e5b1385f388c81fc1b6994c /nanohttp/nanohttp-ssl.c
parent77ce98ff186515cce217814886d9d5b899380c7b (diff)
downloadcsoap-1e0e97fe7b654ecd7f5315d129df6e57f3e63371.tar.gz
csoap-1e0e97fe7b654ecd7f5315d129df6e57f3e63371.tar.bz2
Fix nanoHTTP HTTPS client (still needs port in URL)
Diffstat (limited to 'nanohttp/nanohttp-ssl.c')
-rw-r--r--nanohttp/nanohttp-ssl.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/nanohttp/nanohttp-ssl.c b/nanohttp/nanohttp-ssl.c
index a5f32e3..22aa3d1 100644
--- a/nanohttp/nanohttp-ssl.c
+++ b/nanohttp/nanohttp-ssl.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-ssl.c,v 1.34 2006/11/30 14:24:00 m0gg Exp $
+* $Id: nanohttp-ssl.c,v 1.35 2006/12/01 10:56:00 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2001-2005 Rochester Institute of Technology
@@ -284,7 +284,7 @@ _hssl_parse_arguments(int argc, char **argv)
}
else if (!strcmp(argv[i - 1], NHTTPD_ARG_HTTPS))
{
- hssl_enabled();
+ hssl_enable();
}
}
@@ -437,12 +437,21 @@ hssl_enabled(void)
herror_t
hssl_client_ssl(struct hsocket_t * sock)
{
+ SSL_CTX *ctx;
SSL *ssl;
int ret;
log_verbose1("Starting SSL client initialization");
- if (!(ssl = SSL_new(_hssl_context)))
+ _hssl_library_init();
+
+ if (!(ctx = SSL_CTX_new(SSLv23_method())))
+ {
+ log_error2("SSL_CTX_new failed (ctx == %p)", ctx);
+ return herror_new("hssl_client_ssl", HSSL_ERROR_CONTEXT, "Cannot create SSL client context");
+ }
+
+ if (!(ssl = SSL_new(ctx)))
{
log_error1("Cannot create new SSL object");
return herror_new("hssl_client_ssl", HSSL_ERROR_CLIENT, "SSL_new failed");