subcmd

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigCmd

type ConfigCmd struct {
	ECH  ConfigECHCmd  `command:"ech"  description:"Configure ECH key"`
	MTLS ConfigMTLSCmd `command:"mtls" description:"Configure mTLS key"`
}

ConfigCmd holds the options for the 'config' command.

type ConfigECHCmd

type ConfigECHCmd struct {
	ConfigID   uint8  `long:"config-id" description:"ConfigID for ECH" default:"1"`
	PublicName string `long:"public-name" description:"PublicName for ECH" required:"true"`
}

ConfigECHCmd holds the options for the 'config ech' command.

func (*ConfigECHCmd) Execute

func (o *ConfigECHCmd) Execute(args []string) error

Execute runs the gen-ech command.

type ConfigMTLSCmd

type ConfigMTLSCmd struct {
	CommonName   string        `long:"cn" description:"Common Name for the CA" default:"tlsbin.net"`
	Organization string        `long:"org" description:"Organization for the CA" default:"tlsbin"`
	ValidFor     time.Duration `long:"valid-for" description:"Duration the CA certificate is valid for" default:"8760h"` // 1 year
	CACertPath   string        `long:"ca-cert" description:"Path to the CA certificate" default:"ca.crt"`
	CAKeyPath    string        `long:"ca-key" description:"Path to the CA private key" default:"ca.key"`
}

ConfigMTLSCmd holds the options for the 'config mtls' command.

func (*ConfigMTLSCmd) Execute

func (o *ConfigMTLSCmd) Execute(args []string) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the main server struct

func New

func New(opts ServerCmd) *Server

New creates a new server with the given options.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts the TLS server.

type ServerCmd

type ServerCmd struct {
	Addr          string   `short:"a" long:"addr" description:"Server address" default:"127.0.0.1:8080"`
	TLSCert       string   `long:"tls-cert" description:"TLS certificate file path"`
	TLSKey        string   `long:"tls-key" description:"TLS key file path"`
	TLSMinVersion string   `long:"tls-min-ver" description:"Minimum TLS version" choice:"1.0" choice:"1.1" choice:"1.2" choice:"1.3"`
	TLSMaxVersion string   `long:"tls-max-ver" description:"Maximum TLS version" choice:"1.0" choice:"1.1" choice:"1.2" choice:"1.3"`
	Protocols     []string `long:"alpn" description:"List of application protocols" choice:"http/1.1" choice:"h2"`
	CipherSuites  []string `long:"cipher" description:"List of ciphersuites (TLS1.3 ciphersuites are not configurable)"`
	MTLSAuth      string   `` /* 155-byte string literal not displayed */
	MTLSClientCA  string   `long:"mtls-ca" description:"mTLS Client CA certificate file path"`
	ECHEnabled    bool     `long:"ech-enabled" description:"Enable ECH (Encrypted Client Hello)"`
	ECHKey        string   `long:"ech-key" description:"Base64-encoded ECH private key"`
	ECHConfig     string   `long:"ech-cfg" description:"Base64-encoded ECH configuration"`
}

ServerCmd holds the command-line options for the server command

func (*ServerCmd) Execute

func (o *ServerCmd) Execute(args []string) error

Execute runs the server command.

Jump to

Keyboard shortcuts

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