Documentation
¶
Index ¶
- func ContextValue(c *Config) cli.Action
- func SourceAnnotation() (string, string)
- type Action
- func FlagsAndArgs() Action
- func IDAnnotation(id ID) Action
- func ListCiphers() Action
- func ListCurves() Action
- func SetCACertFile(path ...string) Action
- func SetCACertPath(path ...string) Action
- func SetCiphers(v ...CipherSuites) Action
- func SetClientCertFile(path ...string) Action
- func SetCurves(v ...CurveIDs) Action
- func SetInsecureKeyLogFile(s ...*cli.File) Action
- func SetInsecureSkipVerify(v ...bool) Action
- func SetKeyFile(path ...string) Action
- func SetNextProtos(s ...[]string) Action
- func SetRandom(r ...*cli.File) Action
- func SetServerName(s ...string) Action
- func SetTLSv1() Action
- func SetTLSv1_0() Action
- func SetTLSv1_1() Action
- func SetTLSv1_2() Action
- func SetTLSv1_3() Action
- func SetTime(s ...*cli.File) Action
- type CipherSuites
- type Config
- type ContextFilter
- type CurveIDs
- type ID
- type Option
- func AddCertificate(cert gotls.Certificate) Option
- func AddRootCACertFile(filename string) Option
- func AddRootCACertPath(path string) Option
- func AddX509KeyPair(certFile, keyFile string) Option
- func WithAction(a cli.Action) Option
- func WithCiphers(ids CipherSuites) Option
- func WithCurves(ids CurveIDs) Option
- func WithDefaultAction() Option
- func WithInsecureSkipVerify(v bool) Option
- func WithKeyLogWriter(w io.Writer) Option
- func WithNextProtos(s []string) Option
- func WithRand(r io.Reader) Option
- func WithServerName(s string) Option
- func WithTimeHelper(f *cli.File) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextValue ¶
func SourceAnnotation ¶
SourceAnnotation gets the name and value of the annotation added to the Data of all flags that are initialized from this package
Types ¶
type Action ¶ added in v0.12.0
Action provides a context action that affects the TLS configuration
func FlagsAndArgs ¶
func FlagsAndArgs() Action
func IDAnnotation ¶ added in v0.13.0
func ListCiphers ¶
func ListCiphers() Action
func ListCurves ¶
func ListCurves() Action
func SetCACertFile ¶
func SetCACertPath ¶
func SetCiphers ¶
func SetCiphers(v ...CipherSuites) Action
func SetClientCertFile ¶
func SetInsecureKeyLogFile ¶ added in v0.9.0
func SetInsecureSkipVerify ¶
func SetKeyFile ¶
func SetNextProtos ¶
func SetServerName ¶
func SetTLSv1_0 ¶
func SetTLSv1_0() Action
func SetTLSv1_1 ¶
func SetTLSv1_1() Action
func SetTLSv1_2 ¶
func SetTLSv1_2() Action
func SetTLSv1_3 ¶
func SetTLSv1_3() Action
type CipherSuites ¶
type CipherSuites []uint16
func (*CipherSuites) Set ¶
func (c *CipherSuites) Set(arg string) error
func (*CipherSuites) String ¶
func (c *CipherSuites) String() string
func (*CipherSuites) Synopsis ¶
func (c *CipherSuites) Synopsis() string
type Config ¶
Config reepresents TLS configuration plus a default action.
func FromContext ¶
FromContext obtains the server from the context.
type ContextFilter ¶ added in v0.14.0
type ContextFilter int
ContextFilter provides the context filters in this package
const ( // Defines provides a context filter for flags and args defined by this package Defines ContextFilter = iota )
func (ContextFilter) Describe ¶ added in v0.14.0
func (f ContextFilter) Describe() string
Describe produces a representation of the context filter suitable for use in messages
func (ContextFilter) MarshalText ¶ added in v0.14.0
func (f ContextFilter) MarshalText() ([]byte, error)
MarshalText provides the textual representation
func (ContextFilter) Matches ¶ added in v0.14.0
func (f ContextFilter) Matches(ctx context.Context) bool
Matches the context filter
func (ContextFilter) String ¶ added in v0.14.0
func (f ContextFilter) String() string
String produces a textual representation of the context filter
func (*ContextFilter) UnmarshalText ¶ added in v0.14.0
func (f *ContextFilter) UnmarshalText(b []byte) error
UnmarshalText converts the textual representation
type ID ¶ added in v0.13.0
type ID int
ID identifies each of the flags and args registered by FlagsAndArgs
const ( IDCACertFile ID IDCACertPath IDCiphers IDClientCertFile IDCurves IDInsecureKeyLogFile IDInsecureSkipVerify IDKeyFile IDListCiphers IDListCurves IDNextProtos IDRandom IDServerName IDTime IDTLSv1 IDTLSv1_0 IDTLSv1_1 IDTLSv1_2 IDTLSv1_3 )
Various identifiers for flags and args registered by the package
func LookupID ¶ added in v0.13.0
LookupID gets the identity of a flag or arg registered by FlagsAndArgs, if present.
func (ID) MarshalText ¶ added in v0.13.0
MarshalText provides the implementation of encoding.TextMarshaler
func (*ID) UnmarshalText ¶ added in v0.13.0
UnmarshalText provides the implementation of encoding.TextUnarshaler
type Option ¶
Option provides an option to the TLS configuration
func AddCertificate ¶ added in v0.7.2
func AddCertificate(cert gotls.Certificate) Option
AddCertificate adds a certificate to the pool
func AddRootCACertFile ¶ added in v0.7.2
AddRootCACertFile adds a CA certificate to the pool
func AddRootCACertPath ¶ added in v0.7.2
AddRootCACertPath adds a search path to the CA certificate pool
func AddX509KeyPair ¶ added in v0.7.2
AddX509KeyPair adds a certificate to the pool
func WithDefaultAction ¶ added in v0.7.3
func WithDefaultAction() Option
WithDefaultAction sets the action to the default
func WithInsecureSkipVerify ¶
WithInsecureSkipVerify sets up the option to skip verification in TLS handshake. This option is insecure.
func WithKeyLogWriter ¶ added in v0.9.0
WithKeyLogWriter sets the KeyLogWriter for debugging TLS connections. This option is insecure and should only be used for debugging purposes.
func WithTimeHelper ¶
WithTimeHelper specifies the file whose modtime contains the time for the server