From 7ea37abc6ac0120ba5f6d94be8d196f7cf1506bb Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Aug 2026 11:14:30 +0200 Subject: [PATCH] openssl: avoid conn reuse if provider is used Reported-by: Stanislav Fort Closes #22665 --- lib/vtls/openssl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 271643e46d..604478cce6 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3756,6 +3756,11 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, ossl_strerror(ERR_peek_error(), error_buffer, sizeof(error_buffer))); return CURLE_OUT_OF_MEMORY; } +#ifdef OPENSSL_HAS_PROVIDERS + if(data->state.libctx) + /* forbid connection reuse with provider/engine use */ + connclose(data->conn); +#endif if(cb_setup) { result = cb_setup(cf, data, cb_user_data);