Caddy private key for SSL cert -->what version of pkcs?

1. My Caddy version (caddy version):

embedded in wekan update to date nightly

2. How I run Caddy:

snap wekan.caddy

a. System environment:

Ubuntu 18.04

Caddy -validate says it cannot parse my private key

I suspect I have to change the pkcs version of my private key with openssl .
What version do I have to convert my private key to for caddy to accept it ?

Regardless if I spec one or two cert and key elements correctly formatted and whether I discreetly reference them or to a folder load and regardless which is specified/listed first, as named to my domain or named as genetric files cert and key (that is 16 permutations) I in the end I get the same error on a validate

Caddyfile:25 - Error during parsing: /var/snap/wekan/common/certs/xxxxxxxx.com.pem: no private key block found

Any info would be great. Thanks

Hi Paul – Caddy can parse private key files that are PEM-encoded ASN.1 DER encodings.

The PKCS version depends on the key type: certmagic/crypto.go at 11467829d42b999bc2502fb9818fa6f10cbf6dd7 · caddyserver/certmagic · GitHub

A valid private key PEM file looks like this (it’s similar for an RSA key):

-----BEGIN EC PRIVATE KEY-----
...
-----END EC PRIVATE KEY-----

Hope that helps!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.