summaryrefslogtreecommitdiffstats
path: root/doc/designs
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-08-09 17:46:33 +0100
committerHugo Landau <hlandau@openssl.org>2023-09-01 10:45:35 +0100
commit24e583619c6f4bb1e7659b6b4f06cea920710688 (patch)
tree41831294bd676cb6efacc48db4af631638a16b49 /doc/designs
parent43f4b8a80ead05900a3a23196c3c4bbb3ed045b1 (diff)
QUIC DDD: ddd-03-fd-blocking: Unplanned changes
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21715)
Diffstat (limited to 'doc/designs')
-rw-r--r--doc/designs/ddd/ddd-03-fd-blocking.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/designs/ddd/ddd-03-fd-blocking.c b/doc/designs/ddd/ddd-03-fd-blocking.c
index 0a890d6abe..1388839cec 100644
--- a/doc/designs/ddd/ddd-03-fd-blocking.c
+++ b/doc/designs/ddd/ddd-03-fd-blocking.c
@@ -22,7 +22,7 @@ SSL_CTX *create_ssl_ctx(void)
SSL_CTX *ctx;
#ifdef USE_QUIC
- ctx = SSL_CTX_new(QUIC_client_method());
+ ctx = SSL_CTX_new(OSSL_QUIC_client_method());
#else
ctx = SSL_CTX_new(TLS_client_method());
#endif
@@ -50,6 +50,9 @@ SSL_CTX *create_ssl_ctx(void)
SSL *new_conn(SSL_CTX *ctx, int fd, const char *bare_hostname)
{
SSL *ssl;
+#ifdef USE_QUIC
+ static const unsigned char alpn[] = {5, 'd', 'u', 'm', 'm', 'y'};
+#endif
ssl = SSL_new(ctx);
if (ssl == NULL)
@@ -72,6 +75,15 @@ SSL *new_conn(SSL_CTX *ctx, int fd, const char *bare_hostname)
return NULL;
}
+#ifdef USE_QUIC
+ /* Configure ALPN, which is required for QUIC. */
+ if (SSL_set_alpn_protos(ssl, alpn, sizeof(alpn))) {
+ /* Note: SSL_set_alpn_protos returns 1 for failure. */
+ SSL_free(ssl);
+ return NULL;
+ }
+#endif
+
return ssl;
}