vulcain icon indicating copy to clipboard operation
vulcain copied to clipboard

tls: failed to parse private key

Open dmouse opened this issue 6 years ago • 3 comments

After to clone and go build I ran:

mkdir tls openssl req -x509 -newkey rsa:4096 -keyout tls/key.pem -out tls/cert.pem -days 365 In this command I added the PEM pass phrase

$ docker run -it -v (pwd)/:/app golang:1.13 bash
root@9e73b18f1a60:/app# go build
root@9e73b18f1a60:/app# UPSTREAM='http://172.18.0.2' ADDR=':3000' KEY_FILE='tls/key.pem' CERT_FILE='tls/cert.pem' ./vulcain
INFO[0000] Vulcain started                               addr=":3000" protocol=https
FATA[0000] tls: failed to parse private key

I think is because vulcain does not know the phrase key

dmouse avatar Oct 11 '19 23:10 dmouse

Yes passphrases aren't supported yet!

dunglas avatar Oct 12 '19 10:10 dunglas

Hi,

I found one post about this issue https://medium.com/@prateeknischal25/using-encrypted-private-keys-with-golang-server-379919955854

If I have time I will try to backport their solution in vulcain.

Laurent

laurent35240 avatar Oct 27 '19 15:10 laurent35240

Hi,

if you are making self signed certificates for a demo project, then you can use -nodes option while making CA certificate then it won't throw error:

1. generate CA's private key and self-signed certificate

openssl req -x509 -newkey rsa:4096 -days 365 -nodes -keyout ca-key.pem -out ca-cert.pem

saurabhgupta11 avatar Jul 15 '20 07:07 saurabhgupta11