Skip to content
Snippets Groups Projects
Verified Commit 66ea149a authored by Tomas Krizek's avatar Tomas Krizek
Browse files

daemon/tls: send fatal alert on handshake failure

If the TLS handshake process fatally fails (e.g. no matching cipher
suite / cert), sent an alert to notify the peer.
parent 6c98b011
Branches
Tags
1 merge request!1007daemon/tls: send fatal error on failed handshake
Pipeline #63911 failed with stages
in 1 hour, 14 minutes, and 54 seconds
......@@ -4,6 +4,7 @@ Knot Resolver 5.x.y (2020-0m-dd)
Bugfixes
--------
- hints module: NODATA answers also for non-address queries (!1005)
- tls: send alert to peer if handshake fails (!1007)
Knot Resolver 5.1.1 (2020-05-19)
......
......@@ -253,6 +253,8 @@ static int tls_handshake(struct tls_common_ctx *ctx, tls_handshake_cb handshake_
kr_log_verbose("[%s] gnutls_handshake failed: %s (%d)\n",
logstring,
gnutls_strerror_name(err), err);
/* Notify the peer about handshake failure via an alert. */
gnutls_alert_send_appropriate(ctx->tls_session, err);
if (handshake_cb) {
handshake_cb(session, -1);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment