Set SID from SSL_CTX This change ensures that the session ID context of an SSL* is updated when its SSL_CTX is updated.
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index f4d6205..70c2b9f 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c
@@ -3166,6 +3166,11 @@ if (ssl->ctx != NULL) SSL_CTX_free(ssl->ctx); /* decrement reference count */ ssl->ctx = ctx; + + ssl->sid_ctx_length = ctx->sid_ctx_length; + assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)); + memcpy(ssl->sid_ctx, ctx->sid_ctx, sizeof(ssl->sid_ctx)); + return(ssl->ctx); }