forked from quic-go/quic-go
Merge pull request #562 from lucas-clemente/fix-flaky-server-test
fix flaky integration tests with the quic_server
This commit is contained in:
@@ -38,11 +38,10 @@ var _ = Describe("Server tests", func() {
|
|||||||
key, err := rsa.GenerateKey(rand.Reader, 1024)
|
key, err := rsa.GenerateKey(rand.Reader, 1024)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
t := time.Now().Add(-time.Minute)
|
|
||||||
templateRoot := &x509.Certificate{
|
templateRoot := &x509.Certificate{
|
||||||
SerialNumber: big.NewInt(1),
|
SerialNumber: big.NewInt(1),
|
||||||
NotBefore: t,
|
NotBefore: time.Now().Add(-time.Hour),
|
||||||
NotAfter: t.Add(time.Hour),
|
NotAfter: time.Now().Add(time.Hour),
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
}
|
}
|
||||||
@@ -130,10 +129,11 @@ var _ = Describe("Server tests", func() {
|
|||||||
// this CA is used to sign the server's key
|
// this CA is used to sign the server's key
|
||||||
// it is set as a valid CA in the QUIC client
|
// it is set as a valid CA in the QUIC client
|
||||||
rootKey, CACert := generateCA()
|
rootKey, CACert := generateCA()
|
||||||
|
// generate the server certificate
|
||||||
template := &x509.Certificate{
|
template := &x509.Certificate{
|
||||||
SerialNumber: big.NewInt(1),
|
SerialNumber: big.NewInt(1),
|
||||||
NotBefore: time.Now(),
|
NotBefore: time.Now().Add(-30 * time.Minute),
|
||||||
NotAfter: time.Now().Add(time.Hour),
|
NotAfter: time.Now().Add(30 * time.Minute),
|
||||||
Subject: pkix.Name{CommonName: "quic.clemente.io"},
|
Subject: pkix.Name{CommonName: "quic.clemente.io"},
|
||||||
}
|
}
|
||||||
certDER, err := x509.CreateCertificate(rand.Reader, template, CACert, &key.PublicKey, rootKey)
|
certDER, err := x509.CreateCertificate(rand.Reader, template, CACert, &key.PublicKey, rootKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user