Documentation
¶
Index ¶
- Constants
- type TLSBytes
- func KubeTLSClientConfigFromSecret(secret corev1.Secret, url string) (*tls.Config, *TLSBytes, error)
- func LegacyTLSClientConfigFromSecret(secret corev1.Secret, url string) (*tls.Config, *TLSBytes, error)
- func TLSClientConfigFromSecret(secret corev1.Secret, url string) (*tls.Config, *TLSBytes, error)
Constants ¶
const CACrtKey = "ca.crt"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TLSBytes ¶
type TLSBytes struct {
// CertBytes is the bytes of the certificate file.
CertBytes []byte
// KeyBytes is the bytes of the key file.
KeyBytes []byte
// CABytes is the bytes of the CA file.
CABytes []byte
}
TLSBytes contains the bytes of the TLS files.
func KubeTLSClientConfigFromSecret ¶
func KubeTLSClientConfigFromSecret(secret corev1.Secret, url string) (*tls.Config, *TLSBytes, error)
KubeTLSClientConfigFromSecret returns a TLS client config as a `tls.Config` object and in its bytes representation. The secret is expected to have the following keys: - tls.key, for the private key - tls.crt, for the certificate - ca.crt, for the CA certificate
Secrets with no certificate, private key, AND CA cert are ignored. If only a certificate OR private key is found, an error is returned. The Secret type can be blank, Opaque or kubernetes.io/tls.
func LegacyTLSClientConfigFromSecret ¶ added in v1.1.1
func LegacyTLSClientConfigFromSecret(secret corev1.Secret, url string) (*tls.Config, *TLSBytes, error)
LegacyTLSClientConfigFromSecret returns a TLS client config as a `tls.Config` object and in its bytes representation. The secret is expected to have the following keys: - keyFile, for the private key - certFile, for the certificate - caFile, for the CA certificate
Secrets with no certificate, private key, AND CA cert are ignored. If only a certificate OR private key is found, an error is returned.
func TLSClientConfigFromSecret ¶
TLSClientConfigFromSecret returns a TLS client config as a `tls.Config` object and in its bytes representation. The secret is expected to have the following keys: - keyFile, for the private key - certFile, for the certificate - caFile, for the CA certificate
Secrets with no certificate, private key, AND CA cert are ignored. If only a certificate OR private key is found, an error is returned. The Secret type can be blank, Opaque or kubernetes.io/tls.