Documentation
¶
Index ¶
- type CmdrTlsConfig
- func (s *CmdrTlsConfig) Dial(network, addr string) (conn net.Conn, err error)
- func (s *CmdrTlsConfig) InitTlsConfigFromCommandline(prefix string)
- func (s *CmdrTlsConfig) InitTlsConfigFromConfigFile(prefix string)
- func (s *CmdrTlsConfig) IsCertValid() bool
- func (s *CmdrTlsConfig) IsClientAuthValid() bool
- func (s *CmdrTlsConfig) IsServerCertValid() bool
- func (s *CmdrTlsConfig) NewTlsListener(l net.Listener) (listener net.Listener, err error)
- func (s *CmdrTlsConfig) ToServerTlsConfig() (config *tls.Config)
- func (s *CmdrTlsConfig) ToTlsConfig() (config *tls.Config)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdrTlsConfig ¶
type CmdrTlsConfig struct { Enabled bool Cacert string // server-side: optional server's CA; client-side: client's CA ServerCert string // client-side: the server's cert Cert string // server-side: server's cert bundle; client-side: client's cert Key string // server-side: server's key; client-side: client's key ClientAuth bool MinTlsVersion uint16 }
CmdrTlsConfig wraps the certificates. For server-side, the `Cert` field must be a bundle of server certificates with all root CAs chain. For server-side, the `Cacert` is optional for extra client CA's.
func NewCmdrTlsConfig ¶
func NewCmdrTlsConfig(prefixInConfigFile, prefixInCommandline string) *CmdrTlsConfig
func (*CmdrTlsConfig) Dial ¶
func (s *CmdrTlsConfig) Dial(network, addr string) (conn net.Conn, err error)
Dial connects to the given network address using net.Dial and then initiates a TLS handshake, returning the resulting TLS connection. Dial interprets a nil configuration as equivalent to the zero configuration; see the documentation of Config for the defaults.
func (*CmdrTlsConfig) InitTlsConfigFromCommandline ¶
func (s *CmdrTlsConfig) InitTlsConfigFromCommandline(prefix string)
func (*CmdrTlsConfig) InitTlsConfigFromConfigFile ¶
func (s *CmdrTlsConfig) InitTlsConfigFromConfigFile(prefix string)
func (*CmdrTlsConfig) IsCertValid ¶
func (s *CmdrTlsConfig) IsCertValid() bool
func (*CmdrTlsConfig) IsClientAuthValid ¶
func (s *CmdrTlsConfig) IsClientAuthValid() bool
func (*CmdrTlsConfig) IsServerCertValid ¶
func (s *CmdrTlsConfig) IsServerCertValid() bool
func (*CmdrTlsConfig) NewTlsListener ¶
func (*CmdrTlsConfig) ToServerTlsConfig ¶
func (s *CmdrTlsConfig) ToServerTlsConfig() (config *tls.Config)
ToServerTlsConfig builds an tls.Config object for server.Serve
func (*CmdrTlsConfig) ToTlsConfig ¶
func (s *CmdrTlsConfig) ToTlsConfig() (config *tls.Config)
Click to show internal directories.
Click to hide internal directories.