Documentation
¶
Index ¶
- func DecodePEM(pemData []byte) (*x509.Certificate, error)
- func GRPCDialOption(dialer *QUICDialer) grpc.DialOption
- func GRPCServerOption(listener *QUICListener) grpc.ServerOption
- func GetCertificateFingerprint(certFile string) (string, error)
- func GetTLSVersion(version string) uint16
- func LoadClientTLSConfig(serverName string, insecureSkipVerify bool) (*tls.Config, error)
- func LoadServerTLSConfig(certFile, keyFile string) (*tls.Config, error)
- func NewQUICClientCredentials(serverName string, insecureSkipVerify bool) (credentials.TransportCredentials, error)
- func NewQUICServerCredentials(certFile, keyFile string) (credentials.TransportCredentials, error)
- func ValidateCertificate(certFile string) error
- func VerifyCertificateChain(certFile, caFile string) error
- type QUICDialer
- type QUICListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePEM ¶
func DecodePEM(pemData []byte) (*x509.Certificate, error)
DecodePEM is a helper function to extract first PEM block
func GRPCDialOption ¶
func GRPCDialOption(dialer *QUICDialer) grpc.DialOption
GRPCDialOption returns gRPC dial options for QUIC transport
func GRPCServerOption ¶
func GRPCServerOption(listener *QUICListener) grpc.ServerOption
GRPCServerOption returns gRPC server options for QUIC transport
func GetCertificateFingerprint ¶
GetCertificateFingerprint calculates SHA256 fingerprint of a certificate Note: This is now optional since we're using one-way TLS
func GetTLSVersion ¶
GetTLSVersion converts string to tls.Version constant
func LoadClientTLSConfig ¶
LoadClientTLSConfig loads client TLS configuration for QUIC (one-way TLS) Uses system root CAs to verify server certificate (e.g., Let's Encrypt) If insecureSkipVerify is true, skips certificate verification (for debugging only)
func LoadServerTLSConfig ¶
LoadServerTLSConfig loads server TLS configuration for QUIC (one-way TLS)
func NewQUICClientCredentials ¶
func NewQUICClientCredentials(serverName string, insecureSkipVerify bool) (credentials.TransportCredentials, error)
NewQUICClientCredentials creates gRPC credentials using QUIC transport
func NewQUICServerCredentials ¶
func NewQUICServerCredentials(certFile, keyFile string) (credentials.TransportCredentials, error)
NewQUICServerCredentials creates gRPC credentials using QUIC transport
func ValidateCertificate ¶
ValidateCertificate checks if a certificate is valid and not expired
func VerifyCertificateChain ¶
VerifyCertificateChain is kept for backward compatibility but not used in one-way TLS In one-way TLS, client uses system root CAs to verify server certificate
Types ¶
type QUICDialer ¶
type QUICDialer struct {
// contains filtered or unexported fields
}
QUICDialer implements gRPC dialer for QUIC
func NewQUICDialer ¶
func NewQUICDialer(tlsConfig *tls.Config) *QUICDialer
NewQUICDialer creates a new QUIC dialer
func (*QUICDialer) DialContext ¶
DialContext dials a QUIC connection
type QUICListener ¶
type QUICListener struct {
// contains filtered or unexported fields
}
QUICListener implements net.Listener for QUIC connections
func NewQUICListener ¶
func NewQUICListener(addr string, tlsConfig *tls.Config) (*QUICListener, error)
NewQUICListener creates a new QUIC listener
func (*QUICListener) Accept ¶
func (l *QUICListener) Accept() (net.Conn, error)
Accept waits for and returns the next connection to the listener
func (*QUICListener) Addr ¶
func (l *QUICListener) Addr() net.Addr
Addr returns the listener's network address