Skip to content

Commit 8d43db4

Browse files
authored
refactor: Use ECDSA instead of RSA for TLS tests (#133)
ECDSA is quite a bit faster and we aren't really testing the security (however it should be just as good if not better)
1 parent c280df0 commit 8d43db4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

transport/tls/tls_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package tls
22

33
import (
44
"context"
5+
"crypto/ecdsa"
6+
"crypto/elliptic"
57
"crypto/rand"
6-
"crypto/rsa"
78
"crypto/tls"
89
"crypto/x509"
910
"crypto/x509/pkix"
@@ -216,7 +217,7 @@ func TestTransport_MultipleMessages(t *testing.T) {
216217

217218
// generateSelfSignedCert creates an in-memory generic cert for testing
218219
func generateSelfSignedCert() (tls.Certificate, error) {
219-
key, err := rsa.GenerateKey(rand.Reader, 2048)
220+
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
220221
if err != nil {
221222
return tls.Certificate{}, err
222223
}

0 commit comments

Comments
 (0)