You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resolved: Failed to invoke gnutls_handshake: An illegal parameter has been received. #13528
Restart systemd-resolved and observe how name resolution just stopped working. Interesting lines from journal (SYSTEMD_LOG_LEVEL set to debug):
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Retrying transaction 47682.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Cache miss for github.com IN AAAA
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Transaction 47682 for <github.com IN AAAA> scope dns on */*.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Using feature level TLS+EDNS0 for transaction 47682.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Sending query via TCP since UDP isn't supported.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Using feature level TLS+EDNS0 for transaction 47682.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Retrying transaction 23197.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Cache miss for github.com IN A
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Transaction 23197 for <github.com IN A> scope dns on */*.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Using feature level TLS+EDNS0 for transaction 23197.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Sending query via TCP since UDP isn't supported.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Using feature level TLS+EDNS0 for transaction 23197.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Failed to invoke gnutls_handshake: An illegal parameter has been received.
wrz 11 18:47:15 Nidhoggr systemd-resolved[40115]: Connection failure for DNS TCP stream: Connection refused
This is happening to me only when Cloudflare DNS is used.
I can reproduce this, although the error message has changed somewhat:
Oct 19 17:01:07 sotha-sil systemd-resolved[14415]: Failed to invoke gnutls_handshake: Error in the push function.
Oct 19 17:01:07 sotha-sil systemd-resolved[14415]: Connection failure for DNS TCP stream: Connection refused
I reproduced the issue with systemd 243.78-1 and gnutls 3.6.10-1 on Arch Linux. It appears to be a GnuTLS systemd bug.
The Client Hello sent by systemd-resolved contains a supported_versions extension with TLS 1.2 and TLS 1.3 (in that order). The order should have been reversed. If the server respects the client preference, then it will negotiate TLS 1.2, compliant with https://tools.ietf.org/html/rfc8446#section-4.2.1
"The extension contains a list of supported versions in preference order, with the most preferred version first."
Since the server (1.1.1.1 in this case) supports TLS 1.3, but the client indicates a preference for TLS 1.2, the server ends up negotiating TLS 1.2. Compliant with the specification, the server indicates a downgrade https://tools.ietf.org/html/rfc8446#page-32. This signal is most likely what triggers the "An illegal parameter has been received." error on the client side.
Cloudflare is working on deploying a fix for this GnuTLS systemd bug, but GnuTLS systemd should be fixed too to avoid future interoperability failures between GnuTLS clients systemd-resolved and other implementations.
The interoperability issue can be reproduced with:
@Lekensteyn Thanks for looking into this. But I have one last question to this. You say that the reason for this issue is the wrong order of TLS algorithms, but why does it work with Googles 8.8.8.8 and TLSv1.3?
Google presumably uses boringssl for their 8.8.8.8 implementation which ignores the client preference for TLS 1.2 if TLS 1.3 is also reported as supported. This is also the reason why a future 1.1.1.1 change will address this issue.
Activity
shibumi commentedon Sep 20, 2019
Yes, it looks like cloudflare is not supporting TLS1.3 and seems like systemd-resolved is trying to speak TLS1.2 with 1.1.1.1. This fails, because of an unknown reason. At least that's what I saw with wireshark. According to a cloudflare employee their are working on TLS1.3, maybe it will get better. https://twitter.com/grittygrease/status/1171103043804286976
Google DNS (8.8.8.8) works fine, btw:

GrantMoyer commentedon Oct 19, 2019
I can reproduce this, although the error message has changed somewhat:
Lekensteyn commentedon Oct 20, 2019
I reproduced the issue with systemd 243.78-1 and gnutls 3.6.10-1 on Arch Linux. It appears to be a
GnuTLSsystemd bug.The Client Hello sent by systemd-resolved contains a supported_versions extension with TLS 1.2 and TLS 1.3 (in that order). The order should have been reversed. If the server respects the client preference, then it will negotiate TLS 1.2, compliant with https://tools.ietf.org/html/rfc8446#section-4.2.1
"The extension contains a list of supported versions in preference order, with the most preferred version first."
Since the server (1.1.1.1 in this case) supports TLS 1.3, but the client indicates a preference for TLS 1.2, the server ends up negotiating TLS 1.2. Compliant with the specification, the server indicates a downgrade https://tools.ietf.org/html/rfc8446#page-32. This signal is most likely what triggers the "An illegal parameter has been received." error on the client side.
Cloudflare is working on deploying a fix for this
GnuTLSsystemd bug, butGnuTLSsystemd should be fixed too to avoid future interoperability failures betweenGnuTLS clientssystemd-resolved and other implementations.The interoperability issue can be reproduced with:
I'll submit a patch for systemd-resolved.
shibumi commentedon Oct 20, 2019
@Lekensteyn Thanks for looking into this. But I have one last question to this. You say that the reason for this issue is the wrong order of TLS algorithms, but why does it work with Googles 8.8.8.8 and TLSv1.3?
Lekensteyn commentedon Oct 20, 2019
Google presumably uses boringssl for their 8.8.8.8 implementation which ignores the client preference for TLS 1.2 if TLS 1.3 is also reported as supported. This is also the reason why a future 1.1.1.1 change will address this issue.
Servers using GnuTLS 3.6.9 or earlier will fail. Since GnuTLS 3.6.10, GnuTLS will also respect the server order, see https://gitlab.com/gnutls/gnutls/issues/837
resolved: fix connection failures with TLS 1.3 and GnuTLS
resolved: fix connection failures with TLS 1.3 and GnuTLS
resolved: fix connection failures with TLS 1.3 and GnuTLS