sous-chefs / openvpn

Development repository for the openvpn cookbook
https://supermarket.chef.io/cookbooks/openvpn
Apache License 2.0
98 stars 160 forks source link

bookworm incompatiblity - easy-rsa 3.x is the cause #226

Closed EugenMayer closed 8 months ago

EugenMayer commented 8 months ago

Not going to invest too much time into creating the issue, regarding that all others have been ignored.

Under bookworm the configuration is created under /etc/openvpn/easy-rsa/pki/openssl.cnf but expected under /etc/openvpn/easy-rsa/pki/openssl-easyrsa.cnf.

So things like this wont work

cd /etc/openvpn/easy-rsa
source ./vars
easy-rsa showca

results in

 easyrsa show-ca
NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/keys
NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/keys
* Notice:
Using Easy-RSA configuration from: /etc/openvpn/easy-rsa/vars

* WARNING:

  Move your vars file to your PKI folder, where it is safe!

sed: can't read /etc/openvpn/easy-rsa/pki/openssl-easyrsa.cnf: No such file or directory

Easy-RSA error:

easyrsa_openssl - Failed to make temporary config

Host: nix | Linux | /bin/zsh

I'am aware that

cat vars | grep KEY_CONFIG
export KEY_CONFIG="${EASY_RSA}/openssl.cnf"

is set, but it is either ignored or no longer valid.

It seems, in general, the vars file seem to have an old/alternative format. Referencing https://github.com/OpenVPN/easy-rsa/blob/master/easyrsa3/vars.example the variables should be

set_var EASYRSA_SSL_CONF    "$EASYRSA_PKI/openssl.cnf"

But this issue is for the entire file, also

export KEY_COUNTRY="DE"

should rather be

set_var EASYRSA_REQ_COUNTRY "US"

As far as i can see, easy-rsa 2.x was compatible with the current vars format https://github.com/OpenVPN/easy-rsa/blob/release/2.x/easy-rsa/2.0/vars - but 3.x is not