Skip to content

Commit 747b6f3

Browse files
committed
Adding CURLOPT_SSL_CTX_FUNCTION support for openssl+wolfssl in ngtcp2 quic. Refs curl#10222.
1 parent 1f693e0 commit 747b6f3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/vquic/curl_ngtcp2.c

+25
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,19 @@ static SSL_CTX *quic_ssl_ctx(struct Curl_cfilter *cf, struct Curl_easy *data)
354354
}
355355
#endif
356356
}
357+
358+
/* give application a chance to interfere with SSL set up. */
359+
if(data->set.ssl.fsslctx) {
360+
CURLcode result;
361+
Curl_set_in_callback(data, true);
362+
result = (*data->set.ssl.fsslctx)(data, ssl_ctx,
363+
data->set.ssl.fsslctxp);
364+
Curl_set_in_callback(data, false);
365+
if(result) {
366+
failf(data, "error signaled by ssl ctx callback");
367+
return NULL;
368+
}
369+
}
357370
return ssl_ctx;
358371
}
359372

@@ -527,6 +540,18 @@ static WOLFSSL_CTX *quic_ssl_ctx(struct Curl_cfilter *cf,
527540
wolfSSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_NONE, NULL);
528541
}
529542

543+
/* give application a chance to interfere with SSL set up. */
544+
if(data->set.ssl.fsslctx) {
545+
CURLcode result;
546+
Curl_set_in_callback(data, true);
547+
result = (*data->set.ssl.fsslctx)(data, ssl_ctx,
548+
data->set.ssl.fsslctxp);
549+
Curl_set_in_callback(data, false);
550+
if(result) {
551+
failf(data, "error signaled by ssl ctx callback");
552+
return NULL;
553+
}
554+
}
530555
return ssl_ctx;
531556
}
532557

0 commit comments

Comments
 (0)