tls.go 3.6 KB

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