25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

caddy.patch 2.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. diff --git a/caddytls/config.go b/caddytls/config.go
  2. index 91c7451..c3e87d5 100644
  3. --- a/caddytls/config.go
  4. +++ b/caddytls/config.go
  5. @@ -241,6 +241,7 @@ func MakeTLSConfig(configs []*Config) (*tls.Config, error) {
  6. if i > 0 && cfg.PreferServerCipherSuites != configs[i-1].PreferServerCipherSuites {
  7. return nil, fmt.Errorf("cannot both use PreferServerCipherSuites and not use it")
  8. }
  9. + config.PreferServerCipherSuites = cfg.PreferServerCipherSuites
  10. // Go with the widest range of protocol versions
  11. if cfg.ProtocolMinVersion < config.MinVersion {
  12. @@ -335,7 +336,7 @@ func SetDefaultTLSParams(config *Config) {
  13. config.ProtocolMinVersion = tls.VersionTLS11
  14. }
  15. if config.ProtocolMaxVersion == 0 {
  16. - config.ProtocolMaxVersion = tls.VersionTLS12
  17. + config.ProtocolMaxVersion = tls.VersionTLS13
  18. }
  19. // Prefer server cipher suites
  20. @@ -357,6 +358,7 @@ var supportedProtocols = map[string]uint16{
  21. "tls1.0": tls.VersionTLS10,
  22. "tls1.1": tls.VersionTLS11,
  23. "tls1.2": tls.VersionTLS12,
  24. + "tls1.3": tls.VersionTLS13,
  25. }
  26. // Map of supported ciphers, used only for parsing config.
  27. @@ -370,6 +372,8 @@ var supportedProtocols = map[string]uint16{
  28. //
  29. // This map, like any map, is NOT ORDERED. Do not range over this map.
  30. var supportedCiphersMap = map[string]uint16{
  31. + "ECDHE-ECDSA-CHACHA20-POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
  32. + "ECDHE-RSA-CHACHA20-POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
  33. "ECDHE-RSA-AES256-GCM-SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  34. "ECDHE-ECDSA-AES256-GCM-SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  35. "ECDHE-RSA-AES128-GCM-SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  36. @@ -391,6 +395,8 @@ var supportedCiphersMap = map[string]uint16{
  37. // Note that TLS_FALLBACK_SCSV is not in this list since it is always
  38. // added manually.
  39. var supportedCiphers = []uint16{
  40. + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
  41. + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
  42. tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  43. tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  44. tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  45. @@ -407,6 +413,8 @@ var supportedCiphers = []uint16{
  46. // List of all the ciphers we want to use by default
  47. var defaultCiphers = []uint16{
  48. + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
  49. + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
  50. tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  51. tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  52. tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,