1
0
forked from aniani/gmnisrv

set session id context

This is necessary now client certificates are supported.
Without it, an attempt to resume a session fails with
"ssl_get_prev_session:session id context uninitialized".
This commit is contained in:
mbays 2021-08-26 18:52:34 +02:00 committed by Drew DeVault
parent 32854b79c7
commit 5783501752

View File

@ -194,6 +194,7 @@ tls_init(struct gmnisrv_config *conf)
assert(r == 1); assert(r == 1);
SSL_CTX_set_tlsext_servername_callback(conf->tls.ssl_ctx, NULL); SSL_CTX_set_tlsext_servername_callback(conf->tls.ssl_ctx, NULL);
SSL_CTX_set_session_id_context(conf->tls.ssl_ctx, (const unsigned char*)"gmnisrv", 7);
SSL_CTX_set_verify(conf->tls.ssl_ctx, SSL_VERIFY_PEER, NULL); SSL_CTX_set_verify(conf->tls.ssl_ctx, SSL_VERIFY_PEER, NULL);
// use always_true_callback to ignore errors such as self-signed error // use always_true_callback to ignore errors such as self-signed error
SSL_CTX_set_cert_verify_callback(conf->tls.ssl_ctx, always_true_callback, NULL); SSL_CTX_set_cert_verify_callback(conf->tls.ssl_ctx, always_true_callback, NULL);