|
12 | 12 |
|
13 | 13 | #include <haproxy/errors.h> |
14 | 14 | #include <haproxy/openssl-compat.h> |
| 15 | +#include <haproxy/quic_ssl.h> |
15 | 16 | #include <haproxy/ssl_ckch.h> |
16 | 17 | #include <haproxy/ssl_sock.h> |
17 | 18 | #include <haproxy/xxhash.h> |
@@ -284,8 +285,12 @@ SSL_CTX *ssl_sock_assign_generated_cert(unsigned int key, struct bind_conf *bind |
284 | 285 | HA_RWLOCK_WRLOCK(SSL_GEN_CERTS_LOCK, &ssl_ctx_lru_rwlock); |
285 | 286 | lru = lru64_lookup(key, ssl_ctx_lru_tree, bind_conf->ca_sign_ckch->cert, 0); |
286 | 287 | if (lru && lru->domain) { |
287 | | - if (ssl) |
| 288 | + if (ssl) { |
288 | 289 | SSL_set_SSL_CTX(ssl, (SSL_CTX *)lru->data); |
| 290 | +#if defined(USE_QUIC) && defined(HAVE_OPENSSL_QUIC) |
| 291 | + quic_ssl_set_tls_cbs(ssl); |
| 292 | +#endif |
| 293 | + } |
289 | 294 | HA_RWLOCK_WRUNLOCK(SSL_GEN_CERTS_LOCK, &ssl_ctx_lru_rwlock); |
290 | 295 | return (SSL_CTX *)lru->data; |
291 | 296 | } |
@@ -354,12 +359,18 @@ int ssl_sock_generate_certificate(const char *servername, struct bind_conf *bind |
354 | 359 | lru64_commit(lru, ssl_ctx, cacert, 0, (void (*)(void *))SSL_CTX_free); |
355 | 360 | } |
356 | 361 | SSL_set_SSL_CTX(ssl, ssl_ctx); |
| 362 | +#if defined(USE_QUIC) && defined(HAVE_OPENSSL_QUIC) |
| 363 | + quic_ssl_set_tls_cbs(ssl); |
| 364 | +#endif |
357 | 365 | HA_RWLOCK_WRUNLOCK(SSL_GEN_CERTS_LOCK, &ssl_ctx_lru_rwlock); |
358 | 366 | return 1; |
359 | 367 | } |
360 | 368 | else { |
361 | 369 | ssl_ctx = ssl_sock_do_create_cert(servername, bind_conf, ssl); |
362 | 370 | SSL_set_SSL_CTX(ssl, ssl_ctx); |
| 371 | +#if defined(USE_QUIC) && defined(HAVE_OPENSSL_QUIC) |
| 372 | + quic_ssl_set_tls_cbs(ssl); |
| 373 | +#endif |
363 | 374 | /* No LRU cache, this CTX will be released as soon as the session dies */ |
364 | 375 | SSL_CTX_free(ssl_ctx); |
365 | 376 | return 1; |
|
0 commit comments