Skip to content

Commit 152e5ce

Browse files
committed
Add QUIC support
This commit exposes various QUIC methods so that you can build QUIC clients and servers
1 parent 38a1a4a commit 152e5ce

6 files changed

Lines changed: 853 additions & 3 deletions

File tree

ext/openssl/extconf.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,29 @@ def find_openssl_library
169169
# added in 3.5.0
170170
have_func("SSL_get0_peer_signature_name(NULL, NULL)", ssl_h)
171171

172+
# QUIC support - added in OpenSSL 3.2.0
173+
have_func("OSSL_QUIC_client_method()", ssl_h)
174+
have_func("OSSL_QUIC_client_thread_method()", ssl_h)
175+
have_func("SSL_new_stream(NULL, 0)", ssl_h)
176+
have_func("SSL_accept_stream(NULL, 0)", ssl_h)
177+
have_func("SSL_stream_conclude(NULL)", ssl_h)
178+
have_func("SSL_get_stream_id(NULL)", ssl_h)
179+
have_func("SSL_set_default_stream_mode(NULL, 0)", ssl_h)
180+
have_func("SSL_set_blocking_mode(NULL, 0)", ssl_h)
181+
have_func("SSL_get_blocking_mode(NULL)", ssl_h)
182+
have_func("SSL_handle_events(NULL)", ssl_h)
183+
have_func("SSL_get_event_timeout(NULL, NULL, NULL)", ssl_h)
184+
have_func("SSL_get0_connection(NULL)", ssl_h)
185+
have_func("SSL_is_connection(NULL)", ssl_h)
186+
have_func("SSL_set1_initial_peer_addr(NULL, NULL)", ssl_h)
187+
have_func("OSSL_QUIC_server_method()", ssl_h)
188+
have_func("SSL_new_listener(NULL, 0)", ssl_h)
189+
have_func("SSL_accept_connection(NULL, 0)", ssl_h)
190+
have_func("SSL_get_accept_connection_queue_len(NULL)", ssl_h)
191+
have_func("SSL_listen(NULL)", ssl_h)
192+
have_func("SSL_poll(NULL, 0, 0, NULL, 0, NULL)", ssl_h)
193+
have_func("SSL_set_incoming_stream_policy(NULL, 0, 0)", ssl_h)
194+
172195
Logging::message "=== Checking done. ===\n"
173196

174197
# Append flags from environment variables.

ext/openssl/ossl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
# define OSSL_HAVE_IMMUTABLE_PKEY
7979
#endif
8080

81+
#if !OSSL_IS_LIBRESSL && defined(HAVE_OSSL_QUIC_CLIENT_METHOD)
82+
# define OSSL_USE_QUIC
83+
#endif
84+
8185
/*
8286
* Common Module
8387
*/

0 commit comments

Comments
 (0)