refactor: simplify tls config in rest (#1181)

This commit is contained in:
Kevin Wan
2021-10-31 14:10:47 +08:00
committed by GitHub
parent cd1f8da13f
commit 769d06c8ab
6 changed files with 96 additions and 78 deletions

View File

@@ -227,8 +227,10 @@ Port: 54321
var cnf RestConf
assert.Nil(t, conf.LoadConfigFromYamlBytes([]byte(configYaml), &cnf))
testConfig := []uint16{
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
testConfig := &tls.Config{
CipherSuites: []uint16{
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
},
}
testCases := []struct {
@@ -239,7 +241,7 @@ Port: 54321
{
c: cnf,
opts: []RunOption{WithTLSConfig(testConfig)},
res: &tls.Config{CipherSuites: testConfig},
res: testConfig,
},
{
c: cnf,