Documentation
¶
Index ¶
- Constants
- func AWSVPCEndpointID(tlv proxyproto.TLV) (string, error)
- func ExtractPSCConnectionID(tlvs []proxyproto.TLV) (uint64, bool)
- func FindAWSVPCEndpointID(tlvs []proxyproto.TLV) string
- func FindAzurePrivateEndpointLinkID(tlvs []proxyproto.TLV) (uint32, bool)
- func IsAWSVPCEndpointID(tlv proxyproto.TLV) bool
- func IsSSL(t proxyproto.TLV) bool
- type PP2SSL
- func (s PP2SSL) ClientCN() (string, bool)
- func (s PP2SSL) ClientCertConn() bool
- func (s PP2SSL) ClientCertSess() bool
- func (s PP2SSL) ClientSSL() bool
- func (s PP2SSL) Marshal() (proxyproto.TLV, error)
- func (s PP2SSL) SSLCipher() (string, bool)
- func (s PP2SSL) SSLVersion() (string, bool)
- func (s PP2SSL) Verified() bool
Constants ¶
const ( // Amazon's extension PP2_TYPE_AWS = 0xEA PP2_SUBTYPE_AWS_VPCE_ID = 0x01 )
const ( // Azure's extension PP2_TYPE_AZURE = 0xEE PP2_SUBTYPE_AZURE_PRIVATEENDPOINT_LINKID = 0x01 )
const ( // pp2_tlv_ssl.client bit fields PP2_BITFIELD_CLIENT_SSL uint8 = 0x01 PP2_BITFIELD_CLIENT_CERT_CONN uint8 = 0x02 PP2_BITFIELD_CLIENT_CERT_SESS uint8 = 0x04 )
const ( // PP2_TYPE_GCP indicates a Google Cloud Platform header PP2_TYPE_GCP proxyproto.PP2Type = 0xE0 )
Variables ¶
This section is empty.
Functions ¶
func AWSVPCEndpointID ¶
func AWSVPCEndpointID(tlv proxyproto.TLV) (string, error)
func ExtractPSCConnectionID ¶ added in v0.6.1
func ExtractPSCConnectionID(tlvs []proxyproto.TLV) (uint64, bool)
ExtractPSCConnectionID returns the first PSC Connection ID in the TLV if it exists and is well-formed and a bool indicating one was found.
func FindAWSVPCEndpointID ¶
func FindAWSVPCEndpointID(tlvs []proxyproto.TLV) string
FindAWSVPCEndpointID returns the first AWS VPC ID in the TLV if it exists and is well-formed.
func FindAzurePrivateEndpointLinkID ¶
func FindAzurePrivateEndpointLinkID(tlvs []proxyproto.TLV) (uint32, bool)
FindAzurePrivateEndpointLinkID returns the first Azure Private Endpoint LinkID if it exists in the TLV collection and a boolean indicating if it was found.
func IsAWSVPCEndpointID ¶
func IsAWSVPCEndpointID(tlv proxyproto.TLV) bool
Types ¶
type PP2SSL ¶
type PP2SSL struct {
Client uint8 // The <client> field is made of a bit field from the following values,
// indicating which element is present: PP2_BITFIELD_CLIENT_SSL,
// PP2_BITFIELD_CLIENT_CERT_CONN, PP2_BITFIELD_CLIENT_CERT_SESS
Verify uint32 // Verify will be zero if the client presented a certificate
// and it was successfully verified, and non-zero otherwise.
TLV []proxyproto.TLV
}
2.2.5. The PP2_TYPE_SSL type and subtypes
struct pp2_tlv_ssl {
uint8_t client;
uint32_t verify;
struct pp2_tlv sub_tlv[0];
};
func FindSSL ¶
func FindSSL(tlvs []proxyproto.TLV) (PP2SSL, bool)
SSL returns the first PP2SSL if it exists and is well formed as well as bool indicating if it was found.
func SSL ¶
func SSL(t proxyproto.TLV) (PP2SSL, error)
SSL returns the pp2_tlv_ssl from section 2.2.5 or errors with ErrIncompatibleTLV or ErrMalformedTLV
func (PP2SSL) ClientCN ¶
ClientCN returns the string representation (in UTF8) of the Common Name field (OID: 2.5.4.3) of the client certificate's Distinguished Name and whether that extension exists.
func (PP2SSL) ClientCertConn ¶
ClientCertConn indicates that the client provided a certificate over the current connection.
func (PP2SSL) ClientCertSess ¶
ClientCertSess indicates that the client provided a certificate at least once over the TLS session this connection belongs to.
func (PP2SSL) ClientSSL ¶
ClientSSL indicates that the client connected over SSL/TLS. When true, SSLVersion will return the version.
func (PP2SSL) Marshal ¶ added in v0.3.0
func (s PP2SSL) Marshal() (proxyproto.TLV, error)
Marshal formats the PP2SSL structure as a TLV.
func (PP2SSL) SSLCipher ¶ added in v0.7.0
SSLCipher returns the US-ASCII string representation of the used TLS cipher and whether that extension exists.
func (PP2SSL) SSLVersion ¶
SSLVersion returns the US-ASCII string representation of the TLS version and whether that extension exists.