1
0
mirror of https://github.com/juanfont/headscale.git synced 2024-12-20 19:09:07 +01:00

Clean up cert function

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2022-11-10 08:02:40 +00:00 committed by Juan Font
parent 9bc6ac0f35
commit 69440058bb

View File

@ -362,6 +362,7 @@ func (t *HeadscaleInContainer) WriteFile(path string, data []byte) error {
return integrationutil.WriteFileToContainer(t.pool, t.container, path, data)
}
//nolint
func createCertificate() ([]byte, []byte, error) {
// From:
// https://shaneutt.com/blog/golang-ca-and-signed-cert-go/
@ -389,11 +390,6 @@ func createCertificate() ([]byte, []byte, error) {
return nil, nil, err
}
// caBytes, err := x509.CreateCertificate(rand.Reader, ca, ca, &caPrivKey.PublicKey, caPrivKey)
// if err != nil {
// return nil, err
// }
cert := &x509.Certificate{
SerialNumber: big.NewInt(1658),
Subject: pkix.Name{
@ -445,10 +441,5 @@ func createCertificate() ([]byte, []byte, error) {
return nil, nil, err
}
// serverCert, err := tls.X509KeyPair(certPEM.Bytes(), certPrivKeyPEM.Bytes())
// if err != nil {
// return nil, err
// }
return certPEM.Bytes(), certPrivKeyPEM.Bytes(), nil
}