tls.go 3.0 KB

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