Fix test using rsa bytes without pem encoding

This commit is contained in:
Melon 2023-07-07 15:53:48 +01:00
parent 43905a3dc3
commit cebad8224c
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -124,14 +124,14 @@ func setupPebbleTest(t *testing.T, serverTls *certgen.CertGen) *Service {
service, err := NewService(wg, db, acmeProv, LetsEncryptConfig{
Account: LetsEncryptAccount{
Email: "webmaster@example.test",
PrivateKey: string(x509.MarshalPKCS1PrivateKey(lePrivKey)),
PrivateKey: string(pem.EncodeToMemory(&pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(lePrivKey)})),
},
Directory: "https://localhost:14000/dir",
Certificate: string(certRaw),
insecure: true,
}, certDir, keyDir)
service.transport = acmeProv
assert.NoError(t, err)
service.transport = acmeProv
privKey, err := rsa.GenerateKey(rand.Reader, 2048)
assert.NoError(t, err)