tls

package
v0.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package tls provides utilities for configuring and managing Transport Layer Security (TLS) in server and client environments, with a focus on QUIC protocol support and testing configurations.

The package includes functions for cloning and customizing TLS configurations as well as generating self-signed certificates for development and testing purposes.

Key Features:

  • `ServerQUICTLSConfig`: Creates a server-side TLS configuration tailored for QUIC protocol with specified or default settings. QUIC requires a specific TLS configuration with proper ALPN (Application-Layer Protocol Negotiation) support, making the TLS settings crucial for establishing secure connections.

  • `ClientQUICTLSConfig`: Provides a client-side TLS configuration suitable for QUIC protocol. The configuration differs between development (insecure testing) and production (strict verification).

  • `generateTestTLSConfig`: Generates a self-signed TLS configuration for use in local development and testing scenarios.

Usage:

This package provides separate implementations for development and production environments. The development implementation (guarded by `//go:build devcert`) supports testing configurations with self-signed certificates and insecure client connections. The production implementation (guarded by `//go:build !devcert`) ensures that valid and secure TLS configurations are supplied and used.

The QUIC protocol is highly reliant on properly configured TLS settings, and this package ensures that configurations meet the requirements for secure and efficient QUIC communication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientQUICTLSConfig

func ClientQUICTLSConfig() *tls.Config

func ServerQUICTLSConfig

func ServerQUICTLSConfig(originTLSCfg *tls.Config) (*tls.Config, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL