Documentation ¶
Index ¶
- Variables
- func GetClientTLSConfig(sslConfig *SSLConfig) (*tls.Config, error)
- func GetServerTLSConfig(sslConfig *SSLConfig) (*tls.Config, error)
- func GetX509CACertPool(caCertFile string) (*x509.CertPool, error)
- func LoadTLSCertificate(certFile, keyFile, passphase string, cipher security.Cipher) ([]tls.Certificate, error)
- func ParseSSLCipherSuites(ciphers string) ([]uint16, error)
- func ParseSSLProtocol(sprotocol string) (uint16, error)
- type SSLConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var TLSCipherSuiteMap = map[string]uint16{ "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, }
TLSCipherSuiteMap is a map with key of type string and value of type unsigned integer
View Source
var TLSVersionMap = map[string]uint16{ "TLSv1.0": tls.VersionTLS10, "TLSv1.1": tls.VersionTLS11, "TLSv1.2": tls.VersionTLS12, }
TLSVersionMap is a map with key of type string and value of type unsigned integer
Functions ¶
func GetClientTLSConfig ¶
GetClientTLSConfig function gets client side TLS config
func GetServerTLSConfig ¶
GetServerTLSConfig function gets server side TLD config
func GetX509CACertPool ¶
GetX509CACertPool read a certificate file and gets the certificate configuration
func LoadTLSCertificate ¶
func LoadTLSCertificate(certFile, keyFile, passphase string, cipher security.Cipher) ([]tls.Certificate, error)
LoadTLSCertificate function loads the TLS certificate
func ParseSSLCipherSuites ¶
ParseSSLCipherSuites function parses cipher suites in to a list
func ParseSSLProtocol ¶
ParseSSLProtocol function parses SSL protocols
Types ¶
type SSLConfig ¶
type SSLConfig struct { CipherPlugin string `yaml:"cipher_plugin" json:"cipherPlugin"` VerifyPeer bool `yaml:"verify_peer" json:"verifyPeer"` CipherSuites []uint16 `yaml:"cipher_suites" json:"cipherSuits"` MinVersion uint16 `yaml:"min_version" json:"minVersion"` MaxVersion uint16 `yaml:"max_version" json:"maxVersion"` CAFile string `yaml:"ca_file" json:"caFile"` CertFile string `yaml:"cert_file" json:"certFile"` KeyFile string `yaml:"key_file" json:"keyFile"` CertPWDFile string `yaml:"cert_pwd_file" json:"certPwdFile"` }
SSLConfig struct stores the necessary info for SSL configuration
Click to show internal directories.
Click to hide internal directories.