@@ -64,10 +64,16 @@ func (c Config) Validate() error {
64
64
{c .Web .HTTP == "" && c .Web .HTTPS == "" , "must supply a HTTP/HTTPS address to listen on" },
65
65
{c .Web .HTTPS != "" && c .Web .TLSCert == "" , "no cert specified for HTTPS" },
66
66
{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" },
67
70
{c .GRPC .TLSCert != "" && c .GRPC .Addr == "" , "no address specified for gRPC" },
68
71
{c .GRPC .TLSKey != "" && c .GRPC .Addr == "" , "no address specified for gRPC" },
69
72
{(c .GRPC .TLSCert == "" ) != (c .GRPC .TLSKey == "" ), "must specific both a gRPC TLS cert and key" },
70
73
{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" },
71
77
}
72
78
73
79
var checkErrors []string
@@ -149,6 +155,8 @@ type Web struct {
149
155
HTTPS string `json:"https"`
150
156
TLSCert string `json:"tlsCert"`
151
157
TLSKey string `json:"tlsKey"`
158
+ TLSMinVersion string `json:"tlsMinVersion"`
159
+ TLSMaxVersion string `json:"tlsMaxVersion"`
152
160
AllowedOrigins []string `json:"allowedOrigins"`
153
161
AllowedHeaders []string `json:"allowedHeaders"`
154
162
}
@@ -163,11 +171,13 @@ type Telemetry struct {
163
171
// GRPC is the config for the gRPC API.
164
172
type GRPC struct {
165
173
// 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"`
171
181
}
172
182
173
183
// Storage holds app's storage configuration.
0 commit comments