Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set pre generated TLS key and certificate #1096

Closed
osi8 opened this issue Oct 24, 2024 · 6 comments
Closed

Set pre generated TLS key and certificate #1096

osi8 opened this issue Oct 24, 2024 · 6 comments

Comments

@osi8
Copy link

osi8 commented Oct 24, 2024

Thanks for this amazing software!

I have a LetsEncrypt generated TLS-cert for the domain I am using for warpgate. I tried copying the privkey.pem and the fullchain.pem into the correct folder and set their respective names to tls.key.pem and tls.certificate.pem.

But warpgate won't start with those. It says the private key is bad.
I guess this might come from the different file header, its an EC key. I have seen another ticket where this topic has been discussed, but although I tried to just set the first line in the key manually to -----BEGIN PRIVATE KEY----- warpgate won't start with this key.

Apart from running warpgate behind a TLS terminating reverse proxy, is there a way to use lets encrypt certificates?
Thank you.

@Eugeny
Copy link
Member

Eugeny commented Oct 24, 2024

It should 100% be able to use LE's certificates, what's the error?

#1077 is fixed in v0.11 if you were referring to that

@osi8
Copy link
Author

osi8 commented Oct 24, 2024

Will try again, but yes, #1077 was the one I meant.

Maybe another difference, my key is a wildcard for all possible subdomains of my main domain.

Tried again, error persists:

13:04:02 DEBUG Database cleaned up, next in 60480s
13:04:02  INFO Listening address=0.0.0.0:2222
13:04:02  INFO Listening address=0.0.0.0:8888
13:04:02 ERROR Server error error=invalid private key

@osi8
Copy link
Author

osi8 commented Oct 24, 2024

This is (with obvious replacements) the form of the private key:

-----BEGIN EC PRIVATE KEY-----
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000==
-----END EC PRIVATE KEY-----

@Eugeny
Copy link
Member

Eugeny commented Oct 24, 2024

What's the key_type for your key in the certbot renewal config? (/etc/letsencrypt/renewal)

@osi8
Copy link
Author

osi8 commented Oct 24, 2024

I am using acme.sh, might the parameter Le_Keylength='ec-256' help? Should be an ECC key.

@Eugeny Eugeny closed this as completed in 38dbb3b Oct 24, 2024
@matbgn
Copy link

matbgn commented Feb 22, 2025

🤔 strange, even after the fix I can not import a Let's Encrypt ECC certificate

ERROR Server error error=invalid private key

Exact same structure as @osi8 I tried to store it's content in tls.key.pem

-----BEGIN EC PRIVATE KEY-----
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000==
-----END EC PRIVATE KEY-----

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants