Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#57298 - [easy-rsa] wrong configuration path
Attached to Project:
Arch Linux
Opened by Corubba (corubba) - Tuesday, 30 January 2018, 22:57 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 21 March 2023, 20:26 GMT
Opened by Corubba (corubba) - Tuesday, 30 January 2018, 22:57 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 21 March 2023, 20:26 GMT
|
DetailsDescription:
The with You can think of the path in EASYRSA as the "global config path" and EASYRSA_PKI as the "userspace path" (see descriptions in vars.example file). I suggest to set EASYRSA to "/etc/easy-rsa" and leave EASYRSA_PKI unchanged at the default "$PWD/pki", because upstream expects the globals configs next to the executable but the packaging puts them into /etc. This way it does not break the ability to manage multiple pkis on one machine by simply changing into the appropriate directories (e.g. ~/foo_ca and ~/bar_ca) without the need to unneccessarily copying (or symlinking) all the config files into every pki. easyrsa even supports overriding the globals on a per-pki basis out of the box (see easyrsa script L1089ff). Additional info: * package version(s) easy-rsa 3.0.4-1 |
This task depends upon
From https://github.com/OpenVPN/easy-rsa/blob/master/doc/EasyRSA-Advanced.md
EASYRSA - should point to the Easy-RSA top-level dir, where the easyrsa script is located.
EASYRSA_PKI (CLI: --pki-dir) - dir to use to hold all PKI-specific files, defaults to $PWD/pki.
So EASYRSA seems to contain the readonly configuration (vars, openssl config) while EASYRSA_PKI seems to contain the local PKI config.
$EASYRSA should probably become ${0%/*}/../../etc/easy-rsa while EASYRSA_PKI should be restored to $PWD/pki. I have tested this and it works.
```
$ pacman -Qi easy-rsa
Name : easy-rsa
Version : 3.0.8-2
Description : Simple shell based CA utility
Architecture : any
URL : https://github.com/OpenVPN/easy-rsa
Licenses : custom
Groups : None
Provides : None
Depends On : openssl sh grep
Optional Deps : None
Required By : None
Optional For : openvpn
Conflicts With : None
Replaces : None
Installed Size : 124.94 KiB
Packager : Christian Hesse <arch@eworm.de>
Build Date : Sat 10 Oct 2020 02:51:55 PM
Install Date : Tue 23 Feb 2021 11:46:28 AM
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
```
If I try to use it I see the same error everyone else is:
```
$ mkdir test
$ cd test
$ easyrsa init-pki
init-pki complete; you may now create a CA or requests.
Your newly created PKI dir is: /home/kousu/src/certs/test/test/pki
$ easyrsa build-ca
Using SSL: openssl OpenSSL 1.1.1j 16 Feb 2021
Easy-RSA error:
The OpenSSL config file cannot be found.
Expected location: /home/kousu/src/certs/test/test/pki/openssl-easyrsa.cnf
```
I can workaround it by just:
```
mkdir test
cd test
easyrsa init-pki
cp /etc/easy-rsa/openssl-easyrsa.cnf pki/
easyrsa build-ca
```
Would it be more robust to patch init_pki instead of the EASYRSA variable?
```
--- /usr/bin/easyrsa 2020-10-10 14:51:55.000000000 -0400
+++ easyrsa 2021-02-23 12:15:20.407264578 -0500
@@ -551,9 +551,9 @@
done
# Create $EASYRSA_SAFE_CONF ($OPENSSL_CONF) prevents bogus warnings (especially useful on win32)
- if [ ! -f "$EASYRSA_SSL_CONF" ] && [ -f "$EASYRSA/openssl-easyrsa.cnf" ];
+ if [ ! -f "$EASYRSA_SSL_CONF" ] && [ -f "/etc/easy-rsa/openssl-easyrsa.cnf" ];
then
- cp "$EASYRSA/openssl-easyrsa.cnf" "$EASYRSA_SSL_CONF"
+ cp "/etc/easy-rsa/openssl-easyrsa.cnf" "$EASYRSA_SSL_CONF"
easyrsa_openssl makesafeconf
fi
```
$ export EASYRSA=/etc/easy-rsa
$ easyrsa sign-req server don
Can't open /home/kousu/src/certs/test/test/pki/safessl-easyrsa.cnf for reading, No such file or directory
140691190113664:error:02001002:system library:fopen:No such file or directory:crypto/bio/bss_file.c:69:fopen('/home/kousu/src/certs/test/test/pki/safessl-easyrsa.cnf','r')
140691190113664:error:2006D080:BIO routines:BIO_new_file:no such file:crypto/bio/bss_file.c:76:
Is this still of concern? If not, maybe someone, who was hit by that in the past, could confirm and request closure?
_________
[0] https://github.com/archlinux/svntogit-packages/commit/eaf8e184443c8b4dd907f2b751538a00cbc0035c