This project provides JavaScript implementations for handling TLS 1.3 parameters as defined in RFC 8446 Section 4.1. The code focuses on encoding, decoding, and managing the data structures involved in the ClientHello
, ServerHello
, and HelloRetryRequest
messages during the TLS 1.3 handshake process.
-
ClientHello: Implements the
ClientHello
message structure.- Encodes and decodes client-generated parameters such as
key_share
,supported_versions
, andextensions
. - Validates constraints and ensures compliance with RFC 8446 requirements.
- Encodes and decodes client-generated parameters such as
-
ServerHello: Implements the
ServerHello
message structure.- Handles server responses, including the selected
key_share
andsupported_version
. - Supports encoding, decoding, and serialization of the
ServerHello
fields.
- Handles server responses, including the selected
-
HelloRetryRequest: Implements the
HelloRetryRequest
message structure.- Encodes and decodes server-generated retry requests, including the selected
key_share
. - Ensures proper handling of retry scenarios as specified in the RFC.
- Encodes and decodes server-generated retry requests, including the selected
Import the modules and use them to construct and manage handshake messages:
import { ClientHello, ServerHello, HelloRetryRequest } from "@tls/keyexchange";
// ClientHello usage
const clientHello = new ClientHello();
// ServerHello usage
const serverHello = ServerHello.fromClientHello(ClientHello);
- 4.1.2. ClientHello
- 4.1.3. ServerHello
- 4.1.4. HelloRetryRequest.
This project is licensed under the MIT License - see the LICENSE file for details.