github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/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     Listable[string]       `json:"certificate,omitempty"`
    12  	CertificatePath string                 `json:"certificate_path,omitempty"`
    13  	Key             Listable[string]       `json:"key,omitempty"`
    14  	KeyPath         string                 `json:"key_path,omitempty"`
    15  	ACME            *InboundACMEOptions    `json:"acme,omitempty"`
    16  	ECH             *InboundECHOptions     `json:"ech,omitempty"`
    17  	Reality         *InboundRealityOptions `json:"reality,omitempty"`
    18  }
    19  
    20  type OutboundTLSOptions struct {
    21  	Enabled         bool                    `json:"enabled,omitempty"`
    22  	DisableSNI      bool                    `json:"disable_sni,omitempty"`
    23  	ServerName      string                  `json:"server_name,omitempty"`
    24  	Insecure        bool                    `json:"insecure,omitempty"`
    25  	ALPN            Listable[string]        `json:"alpn,omitempty"`
    26  	MinVersion      string                  `json:"min_version,omitempty"`
    27  	MaxVersion      string                  `json:"max_version,omitempty"`
    28  	CipherSuites    Listable[string]        `json:"cipher_suites,omitempty"`
    29  	Certificate     string                  `json:"certificate,omitempty"`
    30  	CertificatePath string                  `json:"certificate_path,omitempty"`
    31  	ECH             *OutboundECHOptions     `json:"ech,omitempty"`
    32  	UTLS            *OutboundUTLSOptions    `json:"utls,omitempty"`
    33  	Reality         *OutboundRealityOptions `json:"reality,omitempty"`
    34  }
    35  
    36  type InboundRealityOptions struct {
    37  	Enabled           bool                           `json:"enabled,omitempty"`
    38  	Handshake         InboundRealityHandshakeOptions `json:"handshake,omitempty"`
    39  	PrivateKey        string                         `json:"private_key,omitempty"`
    40  	ShortID           Listable[string]               `json:"short_id,omitempty"`
    41  	MaxTimeDifference Duration                       `json:"max_time_difference,omitempty"`
    42  }
    43  
    44  type InboundRealityHandshakeOptions struct {
    45  	ServerOptions
    46  	DialerOptions
    47  }
    48  
    49  type InboundECHOptions struct {
    50  	Enabled                     bool             `json:"enabled,omitempty"`
    51  	PQSignatureSchemesEnabled   bool             `json:"pq_signature_schemes_enabled,omitempty"`
    52  	DynamicRecordSizingDisabled bool             `json:"dynamic_record_sizing_disabled,omitempty"`
    53  	Key                         Listable[string] `json:"key,omitempty"`
    54  	KeyPath                     string           `json:"key_path,omitempty"`
    55  }
    56  
    57  type OutboundECHOptions struct {
    58  	Enabled                     bool             `json:"enabled,omitempty"`
    59  	PQSignatureSchemesEnabled   bool             `json:"pq_signature_schemes_enabled,omitempty"`
    60  	DynamicRecordSizingDisabled bool             `json:"dynamic_record_sizing_disabled,omitempty"`
    61  	Config                      Listable[string] `json:"config,omitempty"`
    62  	ConfigPath                  string           `json:"config_path,omitempty"`
    63  }
    64  
    65  type OutboundUTLSOptions struct {
    66  	Enabled     bool   `json:"enabled,omitempty"`
    67  	Fingerprint string `json:"fingerprint,omitempty"`
    68  }
    69  
    70  type OutboundRealityOptions struct {
    71  	Enabled   bool   `json:"enabled,omitempty"`
    72  	PublicKey string `json:"public_key,omitempty"`
    73  	ShortID   string `json:"short_id,omitempty"`
    74  }