Documentation ¶
Index ¶
- Variables
- func Client(c net.Conn, config *tls.Config) net.Conn
- func Server(c net.Conn, config *tls.Config) net.Conn
- type Certificate
- func (*Certificate) Descriptor() ([]byte, []int)
- func (m *Certificate) GetCertificate() []byte
- func (m *Certificate) GetKey() []byte
- func (m *Certificate) GetUsage() Certificate_Usage
- func (*Certificate) ProtoMessage()
- func (m *Certificate) Reset()
- func (m *Certificate) String() string
- func (m *Certificate) XXX_DiscardUnknown()
- func (m *Certificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Certificate) XXX_Merge(src proto.Message)
- func (m *Certificate) XXX_Size() int
- func (m *Certificate) XXX_Unmarshal(b []byte) error
- type Certificate_Usage
- type Config
- func (c *Config) BuildCertificates() []tls.Certificate
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetAllowInsecure() bool
- func (m *Config) GetAllowInsecureCiphers() bool
- func (m *Config) GetCertificate() []*Certificate
- func (m *Config) GetDisableSessionResumption() bool
- func (m *Config) GetNextProtocol() []string
- func (m *Config) GetServerName() string
- func (c *Config) GetTLSConfig(opts ...Option) *tls.Config
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) String() string
- func (m *Config) XXX_DiscardUnknown()
- func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Config) XXX_Merge(src proto.Message)
- func (m *Config) XXX_Size() int
- func (m *Config) XXX_Unmarshal(b []byte) error
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var Certificate_Usage_name = map[int32]string{
0: "ENCIPHERMENT",
1: "AUTHORITY_VERIFY",
2: "AUTHORITY_ISSUE",
}
View Source
var Certificate_Usage_value = map[string]int32{
"ENCIPHERMENT": 0,
"AUTHORITY_VERIFY": 1,
"AUTHORITY_ISSUE": 2,
}
Functions ¶
Types ¶
type Certificate ¶
type Certificate struct { // TLS certificate in x509 format. Certificate []byte `protobuf:"bytes,1,opt,name=Certificate,proto3" json:"Certificate,omitempty"` // TLS key in x509 format. Key []byte `protobuf:"bytes,2,opt,name=Key,proto3" json:"Key,omitempty"` Usage Certificate_Usage `protobuf:"varint,3,opt,name=usage,proto3,enum=v2ray.core.transport.internet.tls.Certificate_Usage" json:"usage,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func ParseCertificate ¶
func ParseCertificate(c *cert.Certificate) *Certificate
ParseCertificate converts a cert.Certificate to Certificate.
func (*Certificate) Descriptor ¶
func (*Certificate) Descriptor() ([]byte, []int)
func (*Certificate) GetCertificate ¶
func (m *Certificate) GetCertificate() []byte
func (*Certificate) GetKey ¶
func (m *Certificate) GetKey() []byte
func (*Certificate) GetUsage ¶
func (m *Certificate) GetUsage() Certificate_Usage
func (*Certificate) ProtoMessage ¶
func (*Certificate) ProtoMessage()
func (*Certificate) Reset ¶
func (m *Certificate) Reset()
func (*Certificate) String ¶
func (m *Certificate) String() string
func (*Certificate) XXX_DiscardUnknown ¶
func (m *Certificate) XXX_DiscardUnknown()
func (*Certificate) XXX_Marshal ¶
func (m *Certificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Certificate) XXX_Merge ¶
func (dst *Certificate) XXX_Merge(src proto.Message)
func (*Certificate) XXX_Size ¶
func (m *Certificate) XXX_Size() int
func (*Certificate) XXX_Unmarshal ¶
func (m *Certificate) XXX_Unmarshal(b []byte) error
type Certificate_Usage ¶
type Certificate_Usage int32
const ( Certificate_ENCIPHERMENT Certificate_Usage = 0 Certificate_AUTHORITY_VERIFY Certificate_Usage = 1 Certificate_AUTHORITY_ISSUE Certificate_Usage = 2 )
func (Certificate_Usage) EnumDescriptor ¶
func (Certificate_Usage) EnumDescriptor() ([]byte, []int)
func (Certificate_Usage) String ¶
func (x Certificate_Usage) String() string
type Config ¶
type Config struct { // Whether or not to allow self-signed certificates. AllowInsecure bool `protobuf:"varint,1,opt,name=allow_insecure,json=allowInsecure,proto3" json:"allow_insecure,omitempty"` // Whether or not to allow insecure cipher suites. AllowInsecureCiphers bool `protobuf:"varint,5,opt,name=allow_insecure_ciphers,json=allowInsecureCiphers,proto3" json:"allow_insecure_ciphers,omitempty"` // List of certificates to be served on server. Certificate []*Certificate `protobuf:"bytes,2,rep,name=certificate,proto3" json:"certificate,omitempty"` // Override server name. ServerName string `protobuf:"bytes,3,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"` // Lists of string as ALPN values. NextProtocol []string `protobuf:"bytes,4,rep,name=next_protocol,json=nextProtocol,proto3" json:"next_protocol,omitempty"` // Whether or not to disable session (ticket) resumption. DisableSessionResumption bool `` /* 136-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func ConfigFromContext ¶
ConfigFromContext fetches Config from context. Nil if not found.
func (*Config) BuildCertificates ¶
func (c *Config) BuildCertificates() []tls.Certificate
BuildCertificates builds a list of TLS certificates from proto definition.
func (*Config) Descriptor ¶
func (*Config) GetAllowInsecure ¶
func (*Config) GetAllowInsecureCiphers ¶
func (*Config) GetCertificate ¶
func (m *Config) GetCertificate() []*Certificate
func (*Config) GetDisableSessionResumption ¶
func (*Config) GetNextProtocol ¶
func (*Config) GetServerName ¶
func (*Config) GetTLSConfig ¶
GetTLSConfig converts this Config into tls.Config.
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) XXX_DiscardUnknown ¶
func (m *Config) XXX_DiscardUnknown()
func (*Config) XXX_Marshal ¶
func (*Config) XXX_Unmarshal ¶
type Option ¶
Option for building TLS config.
func WithDestination ¶
func WithDestination(dest net.Destination) Option
WithDestination sets the server name in TLS config.
func WithNextProto ¶
WithNextProto sets the ALPN values in TLS config.
Click to show internal directories.
Click to hide internal directories.