Skip to content

Commit

Permalink
use ECDSA for local proxy certs
Browse files Browse the repository at this point in the history
  • Loading branch information
nklaassen committed Oct 5, 2024
1 parent a6c3742 commit 135090c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/client/local_proxy_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ package client
import (
"context"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
Expand All @@ -35,9 +33,9 @@ import (
"github.com/jonboulle/clockwork"

"github.com/gravitational/teleport/api/client/proto"
"github.com/gravitational/teleport/api/constants"
"github.com/gravitational/teleport/api/utils/keys"
"github.com/gravitational/teleport/lib/auth/authclient"
"github.com/gravitational/teleport/lib/cryptosuites"
"github.com/gravitational/teleport/lib/defaults"
"github.com/gravitational/teleport/lib/srv/alpnproxy"
"github.com/gravitational/teleport/lib/tlsca"
Expand Down Expand Up @@ -392,7 +390,7 @@ func (r *LocalCertGenerator) generateCert(host string) (*tls.Certificate, error)
return cert, nil
}

certKey, err := rsa.GenerateKey(rand.Reader, constants.RSAKeySize)
certKey, err := cryptosuites.GenerateKeyWithAlgorithm(cryptosuites.ECDSAP256)
if err != nil {
return nil, trace.Wrap(err)
}
Expand All @@ -406,7 +404,7 @@ func (r *LocalCertGenerator) generateCert(host string) (*tls.Certificate, error)
subject.CommonName = host

certPem, err := certAuthority.GenerateCertificate(tlsca.CertificateRequest{
PublicKey: &certKey.PublicKey,
PublicKey: certKey.Public(),
Subject: subject,
NotAfter: certAuthority.Cert.NotAfter,
DNSNames: []string{host},
Expand Down

0 comments on commit 135090c

Please sign in to comment.