github.com/sagernet/sing-box@v1.2.7/option/tls.go (about)

     1  package option
     2  
     3  type InboundTLSOptions struct {
     4  	Enabled         bool                   `json:"enabled,omitempty"`
     5  	ServerName      string                 `json:"server_name,omitempty"`
     6  	Insecure        bool                   `json:"insecure,omitempty"`
     7  	ALPN            Listable[string]       `json:"alpn,omitempty"`
     8  	MinVersion      string                 `json:"min_version,omitempty"`
     9  	MaxVersion      string                 `json:"max_version,omitempty"`
    10  	CipherSuites    Listable[string]       `json:"cipher_suites,omitempty"`
    11  	Certificate     string                 `json:"certificate,omitempty"`
    12  	CertificatePath string                 `json:"certificate_path,omitempty"`
    13  	Key             string                 `json:"key,omitempty"`
    14  	KeyPath         string                 `json:"key_path,omitempty"`
    15  	ACME            *InboundACMEOptions    `json:"acme,omitempty"`
    16  	Reality         *InboundRealityOptions `json:"reality,omitempty"`
    17  }
    18  
    19  type OutboundTLSOptions struct {
    20  	Enabled         bool                    `json:"enabled,omitempty"`
    21  	DisableSNI      bool                    `json:"disable_sni,omitempty"`
    22  	ServerName      string                  `json:"server_name,omitempty"`
    23  	Insecure        bool                    `json:"insecure,omitempty"`
    24  	ALPN            Listable[string]        `json:"alpn,omitempty"`
    25  	MinVersion      string                  `json:"min_version,omitempty"`
    26  	MaxVersion      string                  `json:"max_version,omitempty"`
    27  	CipherSuites    Listable[string]        `json:"cipher_suites,omitempty"`
    28  	Certificate     string                  `json:"certificate,omitempty"`
    29  	CertificatePath string                  `json:"certificate_path,omitempty"`
    30  	ECH             *OutboundECHOptions     `json:"ech,omitempty"`
    31  	UTLS            *OutboundUTLSOptions    `json:"utls,omitempty"`
    32  	Reality         *OutboundRealityOptions `json:"reality,omitempty"`
    33  }
    34  
    35  type InboundRealityOptions struct {
    36  	Enabled           bool                           `json:"enabled,omitempty"`
    37  	Handshake         InboundRealityHandshakeOptions `json:"handshake,omitempty"`
    38  	PrivateKey        string                         `json:"private_key,omitempty"`
    39  	ShortID           Listable[string]               `json:"short_id,omitempty"`
    40  	MaxTimeDifference Duration                       `json:"max_time_difference,omitempty"`
    41  }
    42  
    43  type InboundRealityHandshakeOptions struct {
    44  	ServerOptions
    45  	DialerOptions
    46  }
    47  
    48  type OutboundECHOptions struct {
    49  	Enabled                     bool   `json:"enabled,omitempty"`
    50  	PQSignatureSchemesEnabled   bool   `json:"pq_signature_schemes_enabled,omitempty"`
    51  	DynamicRecordSizingDisabled bool   `json:"dynamic_record_sizing_disabled,omitempty"`
    52  	Config                      string `json:"config,omitempty"`
    53  }
    54  
    55  type OutboundUTLSOptions struct {
    56  	Enabled     bool   `json:"enabled,omitempty"`
    57  	Fingerprint string `json:"fingerprint,omitempty"`
    58  }
    59  
    60  type OutboundRealityOptions struct {
    61  	Enabled   bool   `json:"enabled,omitempty"`
    62  	PublicKey string `json:"public_key,omitempty"`
    63  	ShortID   string `json:"short_id,omitempty"`
    64  }