...

Package tlsconfigstore

import "github.com/google/s2a-go/internal/v2/tlsconfigstore"
Overview
Index

Overview ▾

Package tlsconfigstore offloads operations to S2Av2.

func ClientConfig

func ClientConfig(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream) func(chi *tls.ClientHelloInfo) (*tls.Config, error)

ClientConfig builds a TLS config for a server to establish a secure connection with a client, based on SNI communicated during ClientHello. Ensures that server presents the correct certificate to establish a TLS connection.

func GetTLSConfigurationForClient

func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentity *commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, serverAuthorizationPolicy []byte) (*tls.Config, error)

GetTLSConfigurationForClient returns a tls.Config instance for use by a client application.

func GetTLSConfigurationForServer

func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode) (*tls.Config, error)

GetTLSConfigurationForServer returns a tls.Config instance for use by a server application.