package credentials

import "google.golang.org/grpc/experimental/credentials"

Package credentials provides experimental TLS credentials. The use of this package is strongly discouraged. These credentials exist solely to maintain compatibility for users interacting with clients that violate the HTTP/2 specification by not advertising support for "h2" in ALPN. This package is slated for removal in upcoming grpc-go releases. Users must not rely on this package directly. Instead, they should either vendor a specific version of gRPC or copy the relevant credentials into their own codebase if absolutely necessary.

Index

Functions

func NewClientTLSFromCertWithALPNDisabled

func NewClientTLSFromCertWithALPNDisabled(cp *x509.CertPool, serverNameOverride string) credentials.TransportCredentials

NewClientTLSFromCertWithALPNDisabled constructs TLS credentials from the provided root certificate authority certificate(s) to validate server connections. If certificates to establish the identity of the client need to be included in the credentials (eg: for mTLS), use NewTLS instead, where a complete tls.Config can be specified. serverNameOverride is for testing only. If set to a non empty string, it will override the virtual host name of authority (e.g. :authority header field) in requests. ALPN verification is disabled.

func NewClientTLSFromFileWithALPNDisabled

func NewClientTLSFromFileWithALPNDisabled(certFile, serverNameOverride string) (credentials.TransportCredentials, error)

NewClientTLSFromFileWithALPNDisabled constructs TLS credentials from the provided root certificate authority certificate file(s) to validate server connections. If certificates to establish the identity of the client need to be included in the credentials (eg: for mTLS), use NewTLS instead, where a complete tls.Config can be specified. serverNameOverride is for testing only. If set to a non empty string, it will override the virtual host name of authority (e.g. :authority header field) in requests. ALPN verification is disabled.

func NewServerTLSFromCertWithALPNDisabled

func NewServerTLSFromCertWithALPNDisabled(cert *tls.Certificate) credentials.TransportCredentials

NewServerTLSFromCertWithALPNDisabled constructs TLS credentials from the input certificate for server. ALPN verification is disabled.

func NewServerTLSFromFileWithALPNDisabled

func NewServerTLSFromFileWithALPNDisabled(certFile, keyFile string) (credentials.TransportCredentials, error)

NewServerTLSFromFileWithALPNDisabled constructs TLS credentials from the input certificate file and key file for server. ALPN verification is disabled.

func NewTLSWithALPNDisabled

func NewTLSWithALPNDisabled(c *tls.Config) credentials.TransportCredentials

NewTLSWithALPNDisabled uses c to construct a TransportCredentials based on TLS. ALPN verification is disabled.

Source Files

tls.go

Directories

PathSynopsis
experimental/credentials/internalPackage internal defines APIs for parsing SPIFFE ID.
Version
v1.70.0 (latest)
Published
Jan 23, 2025
Platform
linux/amd64
Imports
9 packages
Last checked
17 hours ago

Tools for package owners.