mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
240 lines
9.0 KiB
240 lines
9.0 KiB
package tls
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "github.com/golang/protobuf/proto"
|
|
math "math"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type Certificate_Usage int32
|
|
|
|
const (
|
|
Certificate_ENCIPHERMENT Certificate_Usage = 0
|
|
Certificate_AUTHORITY_VERIFY Certificate_Usage = 1
|
|
Certificate_AUTHORITY_ISSUE Certificate_Usage = 2
|
|
)
|
|
|
|
var Certificate_Usage_name = map[int32]string{
|
|
0: "ENCIPHERMENT",
|
|
1: "AUTHORITY_VERIFY",
|
|
2: "AUTHORITY_ISSUE",
|
|
}
|
|
|
|
var Certificate_Usage_value = map[string]int32{
|
|
"ENCIPHERMENT": 0,
|
|
"AUTHORITY_VERIFY": 1,
|
|
"AUTHORITY_ISSUE": 2,
|
|
}
|
|
|
|
func (x Certificate_Usage) String() string {
|
|
return proto.EnumName(Certificate_Usage_name, int32(x))
|
|
}
|
|
|
|
func (Certificate_Usage) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_42ed70cad60a2736, []int{0, 0}
|
|
}
|
|
|
|
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 (m *Certificate) Reset() { *m = Certificate{} }
|
|
func (m *Certificate) String() string { return proto.CompactTextString(m) }
|
|
func (*Certificate) ProtoMessage() {}
|
|
func (*Certificate) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_42ed70cad60a2736, []int{0}
|
|
}
|
|
|
|
func (m *Certificate) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Certificate.Unmarshal(m, b)
|
|
}
|
|
func (m *Certificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Certificate.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Certificate) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Certificate.Merge(m, src)
|
|
}
|
|
func (m *Certificate) XXX_Size() int {
|
|
return xxx_messageInfo_Certificate.Size(m)
|
|
}
|
|
func (m *Certificate) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Certificate.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Certificate proto.InternalMessageInfo
|
|
|
|
func (m *Certificate) GetCertificate() []byte {
|
|
if m != nil {
|
|
return m.Certificate
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Certificate) GetKey() []byte {
|
|
if m != nil {
|
|
return m.Key
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Certificate) GetUsage() Certificate_Usage {
|
|
if m != nil {
|
|
return m.Usage
|
|
}
|
|
return Certificate_ENCIPHERMENT
|
|
}
|
|
|
|
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 `protobuf:"varint,6,opt,name=disable_session_resumption,json=disableSessionResumption,proto3" json:"disable_session_resumption,omitempty"`
|
|
// If true, root certificates on the system will not be loaded for verification.
|
|
DisableSystemRoot bool `protobuf:"varint,7,opt,name=disable_system_root,json=disableSystemRoot,proto3" json:"disable_system_root,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Config) Reset() { *m = Config{} }
|
|
func (m *Config) String() string { return proto.CompactTextString(m) }
|
|
func (*Config) ProtoMessage() {}
|
|
func (*Config) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_42ed70cad60a2736, []int{1}
|
|
}
|
|
|
|
func (m *Config) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Config.Unmarshal(m, b)
|
|
}
|
|
func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Config.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Config) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Config.Merge(m, src)
|
|
}
|
|
func (m *Config) XXX_Size() int {
|
|
return xxx_messageInfo_Config.Size(m)
|
|
}
|
|
func (m *Config) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Config.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Config proto.InternalMessageInfo
|
|
|
|
func (m *Config) GetAllowInsecure() bool {
|
|
if m != nil {
|
|
return m.AllowInsecure
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *Config) GetAllowInsecureCiphers() bool {
|
|
if m != nil {
|
|
return m.AllowInsecureCiphers
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *Config) GetCertificate() []*Certificate {
|
|
if m != nil {
|
|
return m.Certificate
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Config) GetServerName() string {
|
|
if m != nil {
|
|
return m.ServerName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Config) GetNextProtocol() []string {
|
|
if m != nil {
|
|
return m.NextProtocol
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Config) GetDisableSessionResumption() bool {
|
|
if m != nil {
|
|
return m.DisableSessionResumption
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *Config) GetDisableSystemRoot() bool {
|
|
if m != nil {
|
|
return m.DisableSystemRoot
|
|
}
|
|
return false
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("v2ray.core.transport.internet.tls.Certificate_Usage", Certificate_Usage_name, Certificate_Usage_value)
|
|
proto.RegisterType((*Certificate)(nil), "v2ray.core.transport.internet.tls.Certificate")
|
|
proto.RegisterType((*Config)(nil), "v2ray.core.transport.internet.tls.Config")
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("v2ray.com/core/transport/internet/tls/config.proto", fileDescriptor_42ed70cad60a2736)
|
|
}
|
|
|
|
var fileDescriptor_42ed70cad60a2736 = []byte{
|
|
// 435 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xd1, 0x6e, 0xd3, 0x30,
|
|
0x14, 0x86, 0x49, 0x43, 0x0b, 0x3b, 0xed, 0x46, 0xf0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