...

Package tlsutil

import "go.etcd.io/etcd/client/pkg/v3/tlsutil"
Overview
Index

Overview ▾

Package tlsutil provides utility functions for handling TLS.

func GetCipherSuite

func GetCipherSuite(s string) (uint16, bool)

GetCipherSuite returns the corresponding cipher suite, and boolean value if it is supported.

func GetCipherSuites

func GetCipherSuites(ss []string) ([]uint16, error)

GetCipherSuites returns list of corresponding cipher suite IDs.

func GetTLSVersion

func GetTLSVersion(version string) (uint16, error)

GetTLSVersion returns the corresponding tls.Version or error.

func NewCert

func NewCert(certfile, keyfile string, parseFunc func([]byte, []byte) (tls.Certificate, error)) (*tls.Certificate, error)

NewCert generates TLS cert by using the given cert,key and parse function.

func NewCertPool

func NewCertPool(CAFiles []string) (*x509.CertPool, error)

NewCertPool creates x509 certPool with provided CA files.

type TLSVersion

type TLSVersion string

Constants for TLS versions.

const (
    TLSVersionDefault TLSVersion = ""
    TLSVersion12      TLSVersion = "TLS1.2"
    TLSVersion13      TLSVersion = "TLS1.3"
)