This commit is contained in:
Christian Marangi 2026-08-21 00:48:32 -07:00 committed by GitHub
commit 005bde9bf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View file

@ -479,8 +479,12 @@ nsock_event_id nsock_connect_ssl(nsock_pool nsp, nsock_iod nsiod, nsock_ev_handl
if (proto == IPPROTO_UDP)
{
#ifndef OPENSSL_NO_DTLS
if (!ms->dtlsctx)
nsock_pool_dtls_init(ms, 0);
#else
fatal("%s called with no OpenSSL DTLS support", __func__);
#endif
}
else
{

View file

@ -364,7 +364,14 @@ void handle_connect_result(struct npool *ms, struct nevent *nse, enum nse_status
if (nse->type == NSE_TYPE_CONNECT_SSL &&
nse->status == NSE_STATUS_SUCCESS) {
#if HAVE_OPENSSL
sslctx = iod->lastproto == IPPROTO_UDP ? ms->dtlsctx : ms->sslctx;
if (iod->lastproto == IPPROTO_UDP)
#ifndef OPENSSL_NO_DTLS
sslctx = ms->dtlsctx;
#else
fatal("%s called with no OpenSSL DTLS support", __func__);
#endif
else
sslctx = ms->sslctx;
assert(sslctx != NULL);
/* Reuse iod->ssl if present. If set, this is the second try at connection
without the SSL_OP_NO_SSLv2 option set. */

View file

@ -173,7 +173,9 @@ nsock_pool nsock_pool_new(void *userdata) {
#if HAVE_OPENSSL
nsp->sslctx = NULL;
#ifndef OPENSSL_NO_DTLS
nsp->dtlsctx = NULL;
#endif
#endif
nsp->px_chain = NULL;