Backport tls 1.3 support.

Signed-off-by: James Blair <mail@jamesblair.net>
This commit is contained in:
James Blair
2023-03-16 21:46:17 +13:00
parent 2eabc0bc70
commit d8f7cfe28d
10 changed files with 353 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"go.etcd.io/etcd/pkg/expect"
)
@@ -336,3 +337,31 @@ func TestGrpcproxyAndListenCipherSuite(t *testing.T) {
})
}
}
func TestEtcdTLSVersion(t *testing.T) {
d := t.TempDir()
proc, err := spawnCmd(
[]string{
binDir + "/etcd",
"--data-dir", d,
"--name", "e1",
"--listen-client-urls", "https://0.0.0.0:0",
"--advertise-client-urls", "https://0.0.0.0:0",
"--listen-peer-urls", fmt.Sprintf("https://127.0.0.1:%d", etcdProcessBasePort),
"--initial-advertise-peer-urls", fmt.Sprintf("https://127.0.0.1:%d", etcdProcessBasePort),
"--initial-cluster", fmt.Sprintf("e1=https://127.0.0.1:%d", etcdProcessBasePort),
"--peer-cert-file", certPath,
"--peer-key-file", privateKeyPath,
"--cert-file", certPath2,
"--key-file", privateKeyPath2,
"--tls-min-version", "TLS1.2",
"--tls-max-version", "TLS1.3",
},
)
assert.NoError(t, err)
assert.NoError(t, waitReadyExpectProc(proc, etcdServerReadyLines), "did not receive expected output from etcd process")
assert.NoError(t, proc.Stop())
}