Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust ssl verification and options after context change #3317

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/secure-streams/private-lib-secure-streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ typedef struct lws_ss_handle {

union {
struct { /* LWSSSP_H1 */
#if defined(WIN32)
#if defined(WIN32) || defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
uint8_t dummy;
#endif
} h1;
struct { /* LWSSSP_H2 */
#if defined(WIN32)
#if defined(WIN32) || defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
uint8_t dummy;
#endif
} h2;
struct { /* LWSSSP_WS */
#if defined(WIN32)
#if defined(WIN32) || defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
uint8_t dummy;
#endif
} ws;
Expand Down
11 changes: 11 additions & 0 deletions lib/tls/openssl/openssl-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ lws_ssl_server_name_cb(SSL *ssl, int *ad, void *arg)
/* select the ssl ctx from the selected vhost for this conn */
SSL_set_SSL_CTX(ssl, vhost->tls.ssl_ctx);

/* also, adjust other things we care about */
SSL_set_verify(ssl, SSL_CTX_get_verify_mode(vhost->tls.ssl_ctx),
SSL_CTX_get_verify_callback(vhost->tls.ssl_ctx));
SSL_set_verify_depth(ssl, SSL_CTX_get_verify_depth(vhost->tls.ssl_ctx));

#if OPENSSL_VERSION_NUMBER >= 0x009080dfL
SSL_clear_options(ssl, SSL_get_options(ssl) &
~SSL_CTX_get_options(vhost->tls.ssl_ctx));
#endif
SSL_set_options(ssl, SSL_CTX_get_options(vhost->tls.ssl_ctx));

return SSL_TLSEXT_ERR_OK;
}
#endif
Expand Down