@@ -64,10 +64,16 @@ func (c Config) Validate() error {
6464 {c .Web .HTTP == "" && c .Web .HTTPS == "" , "must supply a HTTP/HTTPS address to listen on" },
6565 {c .Web .HTTPS != "" && c .Web .TLSCert == "" , "no cert specified for HTTPS" },
6666 {c .Web .HTTPS != "" && c .Web .TLSKey == "" , "no private key specified for HTTPS" },
67+ {c .Web .TLSMinVersion != "" && c .Web .TLSMinVersion != "1.2" && c .Web .TLSMinVersion != "1.3" , "supported TLS versions are: 1.2, 1.3" },
68+ {c .Web .TLSMaxVersion != "" && c .Web .TLSMaxVersion != "1.2" && c .Web .TLSMaxVersion != "1.3" , "supported TLS versions are: 1.2, 1.3" },
69+ {c .Web .TLSMaxVersion != "" && c .Web .TLSMinVersion != "" && c .Web .TLSMinVersion > c .Web .TLSMaxVersion , "TLSMinVersion greater than TLSMaxVersion" },
6770 {c .GRPC .TLSCert != "" && c .GRPC .Addr == "" , "no address specified for gRPC" },
6871 {c .GRPC .TLSKey != "" && c .GRPC .Addr == "" , "no address specified for gRPC" },
6972 {(c .GRPC .TLSCert == "" ) != (c .GRPC .TLSKey == "" ), "must specific both a gRPC TLS cert and key" },
7073 {c .GRPC .TLSCert == "" && c .GRPC .TLSClientCA != "" , "cannot specify gRPC TLS client CA without a gRPC TLS cert" },
74+ {c .GRPC .TLSMinVersion != "" && c .GRPC .TLSMinVersion != "1.2" && c .GRPC .TLSMinVersion != "1.3" , "supported TLS versions are: 1.2, 1.3" },
75+ {c .GRPC .TLSMaxVersion != "" && c .GRPC .TLSMaxVersion != "1.2" && c .GRPC .TLSMaxVersion != "1.3" , "supported TLS versions are: 1.2, 1.3" },
76+ {c .GRPC .TLSMaxVersion != "" && c .GRPC .TLSMinVersion != "" && c .GRPC .TLSMinVersion > c .GRPC .TLSMaxVersion , "TLSMinVersion greater than TLSMaxVersion" },
7177 }
7278
7379 var checkErrors []string
@@ -149,6 +155,8 @@ type Web struct {
149155 HTTPS string `json:"https"`
150156 TLSCert string `json:"tlsCert"`
151157 TLSKey string `json:"tlsKey"`
158+ TLSMinVersion string `json:"tlsMinVersion"`
159+ TLSMaxVersion string `json:"tlsMaxVersion"`
152160 AllowedOrigins []string `json:"allowedOrigins"`
153161 AllowedHeaders []string `json:"allowedHeaders"`
154162}
@@ -163,11 +171,13 @@ type Telemetry struct {
163171// GRPC is the config for the gRPC API.
164172type GRPC struct {
165173 // The port to listen on.
166- Addr string `json:"addr"`
167- TLSCert string `json:"tlsCert"`
168- TLSKey string `json:"tlsKey"`
169- TLSClientCA string `json:"tlsClientCA"`
170- Reflection bool `json:"reflection"`
174+ Addr string `json:"addr"`
175+ TLSCert string `json:"tlsCert"`
176+ TLSKey string `json:"tlsKey"`
177+ TLSClientCA string `json:"tlsClientCA"`
178+ TLSMinVersion string `json:"tlsMinVersion"`
179+ TLSMaxVersion string `json:"tlsMaxVersion"`
180+ Reflection bool `json:"reflection"`
171181}
172182
173183// Storage holds app's storage configuration.
0 commit comments