You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
desc: "local key and remote TLS Endpoint, certs validated",
298
+
keyFile: RSASampleCertKeyFile,
299
+
caCertFile: RSACaCertFile,
300
+
keyCertMatch: true,
301
+
tlsEndpoint: "localhost:46401",
302
+
tlsServerName: "example.com",
298
303
srvCfg: demoHTTPServerConfig{
299
304
serverAddr: "localhost:46401",
300
305
serverName: "example.com",
301
306
serverCertFile: RSASampleCertFile,
302
307
serverKeyFile: RSASampleCertKeyFile,
303
308
},
304
309
},
310
+
{
311
+
desc: "local key and remote TLS Endpoint, certs NOT validated",
312
+
keyFile: RSASampleCertKeyFile,
313
+
caCertFile: emptyString,
314
+
tlsEndpoint: "localhost:46402",
315
+
tlsServerName: "example.com",
316
+
srvCfg: demoHTTPServerConfig{
317
+
serverAddr: "localhost:46402",
318
+
serverName: "example.com",
319
+
serverCertFile: RSASampleCertFile,
320
+
serverKeyFile: RSASampleCertKeyFile,
321
+
},
322
+
expectCertsFetchErr: true,
323
+
expectCertsFetcMsg: "unable to get endpoint certificates: TLS handshake failed: tls: failed to verify certificate: x509: certificate signed by unknown authority",
324
+
},
325
+
326
+
{
327
+
desc: "local key and remote TLS Endpoint, TLS Insecure",
328
+
keyFile: RSASampleCertKeyFile,
329
+
caCertFile: emptyString,
330
+
keyCertMatch: true,
331
+
tlsEndpoint: "localhost:46403",
332
+
tlsInsecure: true,
333
+
tlsServerName: "example.com",
334
+
srvCfg: demoHTTPServerConfig{
335
+
serverAddr: "localhost:46403",
336
+
serverName: "example.com",
337
+
serverCertFile: RSASampleCertFile,
338
+
serverKeyFile: RSASampleCertKeyFile,
339
+
},
340
+
},
341
+
{
342
+
desc: "local key and remote TLS Endpoint, missing TLS ServerName",
343
+
keyFile: RSASampleCertKeyFile,
344
+
caCertFile: RSACaCertFile,
345
+
tlsEndpoint: "localhost:46404",
346
+
tlsServerName: emptyString,
347
+
srvCfg: demoHTTPServerConfig{
348
+
serverAddr: "localhost:46404",
349
+
serverName: "example.com",
350
+
serverCertFile: RSASampleCertFile,
351
+
serverKeyFile: RSASampleCertKeyFile,
352
+
},
353
+
expectCertsFetchErr: true,
354
+
expectCertsFetcMsg: "unable to get endpoint certificates: TLS handshake failed: tls: failed to verify certificate: x509: certificate is valid for example.com, example.net, example.de, not localhost",
355
+
},
356
+
{
357
+
desc: "local key and remote TLS Endpoint, no key match",
358
+
keyFile: ED25519SamplePlaintextPrivateKey,
359
+
caCertFile: RSACaCertFile,
360
+
keyCertMatch: false,
361
+
tlsEndpoint: "localhost:46405",
362
+
tlsServerName: "example.com",
363
+
srvCfg: demoHTTPServerConfig{
364
+
serverAddr: "localhost:46405",
365
+
serverName: "example.com",
366
+
serverCertFile: RSASampleCertFile,
367
+
serverKeyFile: RSASampleCertKeyFile,
368
+
},
369
+
},
305
370
}
306
371
307
-
for_, tc:=rangenoErrorsTests {
372
+
for_, tc:=rangetests {
308
373
tt:=tc
309
374
t.Run("No errors test - "+tt.desc, func(t*testing.T) {
0 commit comments