mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ssl clean recent external CTX patch so doesnt break build
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
4d9c8fc01a
commit
0c51239023
3 changed files with 13 additions and 12 deletions
|
@ -214,24 +214,15 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
|
|||
sizeof(struct libwebsocket),
|
||||
sizeof(struct allocated_headers));
|
||||
|
||||
|
||||
#ifdef LWS_OPENSSL_SUPPORT
|
||||
if (info->provided_client_ssl_ctx){
|
||||
//use the provided OpenSSL context if given one
|
||||
context->ssl_client_ctx = info->provided_client_ssl_ctx;
|
||||
context->user_supplied_ssl_ctx = 1; //mark to not delet the context on cleanup
|
||||
}
|
||||
#endif
|
||||
if (lws_context_init_server_ssl(info, context))
|
||||
if (lws_context_init_server_ssl(info, context))
|
||||
goto bail;
|
||||
if (!context->ssl_client_ctx && lws_context_init_client_ssl(info, context))
|
||||
|
||||
if (lws_context_init_client_ssl(info, context))
|
||||
goto bail;
|
||||
|
||||
if (lws_context_init_server(info, context))
|
||||
goto bail;
|
||||
|
||||
lwsl_debug(" client SSL ctx %p\n", context->ssl_client_ctx);
|
||||
lwsl_debug(" server SSL ctx %p\n", context->ssl_ctx);
|
||||
/*
|
||||
* drop any root privs for this process
|
||||
* to listen on port < 1023 we would have needed root, but now we are
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "private-libwebsockets.h"
|
||||
|
||||
#ifndef LWS_NO_SERVER
|
||||
#ifdef LWS_OPENSSL_SUPPORT
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
|
||||
static int alpn_select_proto_cb(SSL* ssl,
|
||||
|
@ -75,4 +76,5 @@ lws_context_init_http2_ssl(struct libwebsocket_context *context)
|
|||
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -238,6 +238,14 @@ int lws_context_init_client_ssl(struct lws_context_creation_info *info,
|
|||
int n;
|
||||
SSL_METHOD *method;
|
||||
|
||||
if (info->provided_client_ssl_ctx) {
|
||||
/* use the provided OpenSSL context if given one */
|
||||
context->ssl_client_ctx = info->provided_client_ssl_ctx;
|
||||
/* nothing for lib to delete */
|
||||
context->user_supplied_ssl_ctx = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (info->port != CONTEXT_PORT_NO_LISTEN)
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue