MatrixAI / js-quic

QUIC Networking for TypeScript & JavaScript
https://matrixai.github.io/js-quic/
Apache License 2.0
13 stars 1 forks source link

Improve error message for TLS crypto errors #124

Open tegefaulkes opened 1 month ago

tegefaulkes commented 1 month ago

Specification

Recently when we were debugging an issue in Polykey we ran into the following error.

INFO:polykey.PolykeyAgent.NodeConnectionManager.NodeConnectionForward [13.239.117.143:1314].QUICClient:ErrorQUICConnectionPeerTLS: QUIC Connection local TLS error - Peer closed with transport code 301

For the sake of clarity, if we create TLS errors like this we should include the error name along with the code so we don't have to dig though the code to know what the error is. We already have a defined enum called CryptoError that provides the forward and reverse mapping for these codes. We just need to add this to the error description so we can see Peer closed with transport code 301 (CertificateExpired)

The same treatment can be applied to the ConnectionErrorCode enum usage as well.

Additional context

Related: https://github.com/MatrixAI/Polykey/issues/787

Tasks

  1. when creating the message for ErrorQUICConnectionPeerTLS and ErrorQUICConnectionLocalTLS errors we want to use the CryptoError to include the name of the error code.
  2. The same needs to be applied to ConnectionErrorCode codes.
linear[bot] commented 1 month ago

ENG-391 Improve error message for TLS crypto errors