diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-08-09 17:46:32 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-09-01 10:45:33 +0100 |
commit | 881e3299dcadd65cc4a2843ba47abc6548ced8f4 (patch) | |
tree | 0456fef69d23abb31cb9d3eee50ac8b58b0f535f | |
parent | da57c0eaf22c390f9b38c42ca1bd7daca4effd2f (diff) |
QUIC TLS: Better error message when ALPN not used
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21715)
-rw-r--r-- | ssl/quic/quic_tls.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ssl/quic/quic_tls.c b/ssl/quic/quic_tls.c index 8b9f812253..b0da216e37 100644 --- a/ssl/quic/quic_tls.c +++ b/ssl/quic/quic_tls.c @@ -672,8 +672,8 @@ static int raise_error(QUIC_TLS *qtls, uint64_t error_code, ERR_new(); ERR_set_debug(src_file, src_line, src_func); ERR_set_error(ERR_LIB_SSL, SSL_R_QUIC_HANDSHAKE_LAYER_ERROR, - "handshake layer error, error code %llu (\"%s\")", - (unsigned long long)error_code, error_msg); + "handshake layer error, error code %llu (0x%llx) (\"%s\")", + error_code, error_code, error_msg); OSSL_ERR_STATE_save_to_mark(qtls->error_state); /* @@ -743,7 +743,8 @@ int ossl_quic_tls_tick(QUIC_TLS *qtls) return RAISE_INTERNAL_ERROR(qtls); } else { if (sc->ext.alpn == NULL || sc->ext.alpn_len == 0) - return RAISE_INTERNAL_ERROR(qtls); + return RAISE_ERROR(qtls, QUIC_ERR_CRYPTO_NO_APP_PROTO, + "ALPN must be configured when using QUIC"); } if (!SSL_set_min_proto_version(qtls->args.s, TLS1_3_VERSION)) return RAISE_INTERNAL_ERROR(qtls); |