openssl/openssl

SSL_new() fails for QUIC and OPENSSL_THREADS_NONE

Open

#22,982 opened on Dec 8, 2023

View on GitHub
 (8 comments) (2 reactions) (0 assignees)C (11,262 forks)batch import
backlog fixbranch: masterhelp wantedtriaged: feature

Repository metrics

Stars
 (30,157 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

When OPENSSL_THREADS and OPENSSL_THREADS_NONE are both defined, SSL_new() fails for QUIC connections because of the following code:

https://github.com/openssl/openssl/blob/986c48c4eb26861f25bc68ea252d8f2aad592735/ssl/quic/quic_impl.c#L387-L392

Should the code really fail at that point if OPENSSL_THREADS_NONE is defined? In such a case, removing the those lines of code allows a QUIC connection to be successfully established.

For some context, in the OpenSSL port for AmiSSL, we have been using the existing thread/locking functions, as per crypto/threads*.c for many years, but for 3.2.0 we currently are building with thread pools disabled and no threaded implementation for QUIC.

Contributor guide