Documentation
¶
Index ¶
- Constants
- func GetClientCertPool(tlsCertFile string, caCertFile string) (*x509.CertPool, error)
- func GetGrpcDialOption(config *tls.Config) grpc.DialOption
- func GetLocalTLSConfig() (*tls.Config, error)
- func GetLocalTLSData() ([]byte, []byte, error)
- func GetTLSClientConfig(tlsMode TLSMode, serverAddr string, ...) (*tls.Config, error)
- func GetTLSClientDialOption(tlsMode TLSMode, serverAddr string, ...) (grpc.DialOption, error)
- func IsTestTls() bool
- func ServerAuthServerCreds(tlsCertFile, tlsKeyFile string) (credentials.TransportCredentials, error)
- type TLSMode
Constants ¶
const LocalTLSCertsDir = "/tmp/edge-cloud-test-certs/out"
LocalTLSCertsDir contains certs generated by gen-test-certs.sh for local testing use.
Variables ¶
This section is empty.
Functions ¶
func GetClientCertPool ¶
GetClientCertPool gets the system cert pool for all the trusted CA certs and then appends the caCertFile. Leave caCertFile blank to use the mex-ca.crt
func GetGrpcDialOption ¶
func GetGrpcDialOption(config *tls.Config) grpc.DialOption
func GetLocalTLSConfig ¶
func GetLocalTLSData ¶
func GetTLSClientConfig ¶
func GetTLSClientConfig(tlsMode TLSMode, serverAddr string, getCertFunc func(*tls.CertificateRequestInfo) (*tls.Certificate, error), tlsCertFile string, caCertFile string, skipVerify bool) (*tls.Config, error)
GetTLSClientConfig builds client side TLS configuration. If the serverAddr is blank, no validation is done on the cert. CaCertFile is specified when communicating to exernal servers with their own privately signed certs. Leave this blank to use the mex-ca.crt. Requires either a tlsCertFile or a getCertFunc if mutualAuth
func GetTLSClientDialOption ¶
func GetTLSClientDialOption(tlsMode TLSMode, serverAddr string, getCertFunc func(*tls.CertificateRequestInfo) (*tls.Certificate, error), tlsCertFile string, skipVerify bool) (grpc.DialOption, error)
GetTLSClientDialOption gets GRPC options needed for TLS connection
func ServerAuthServerCreds ¶
func ServerAuthServerCreds(tlsCertFile, tlsKeyFile string) (credentials.TransportCredentials, error)
ServerAuthServerCreds gets grpc credentials for the server for server-side authentication.