I am trying to set up an OpenVPN server on a brand new RPi3B with Raspbian Stretch from the Sept 2017 image.
I have performed all the usual steps using apt-get to install openvpn and it got me version 2.4.0
Previous installations I have done on Raspbian Wheezy ended up with 2.1.xx.
On 2.4.0 easy-rsa is part of the install but is hidden in /usr/share/easy-rsa, so I copied it to /etc/openvpn/easy-rsa
Now I have edited the vars script and it seemed satisfied after I replaced the double quotes in these lines:
export EASY_RSA="/etc/openvpn/easy-rsa"
export KEY_CONFIG="$EASY_RSA/whichopensslcnf $EASY_RSA"
But when I run the command ./build-ca I get this displayed:
root@rpi3-vpn:/etc/openvpn/easy-rsa# ./build-ca
grep: /etc/openvpn/easy-rsa/whichopensslcnf /etc/openvpn/easy-rsa: No such file or directory
pkitool: KEY_CONFIG (set by the ./vars script) is pointing to the wrong
version of openssl.cnf: /etc/openvpn/easy-rsa/whichopensslcnf /etc/openvpn/easy-rsa
The correct version should have a comment that says: easy-rsa version 2.x
What does this mean and what can I do to fix it?
I checked the openssl version:
root@rpi3-vpn:/etc/openvpn/easy-rsa# openssl version
OpenSSL 1.1.0f 25 May 2017
And in the easy-rsa dir there are the following sample openssl.cnf files:
-rw-r--r-- 1 root root 7859 Jul 13 2015 openssl-0.9.6.cnf
-rw-r--r-- 1 root root 8416 Jul 13 2015 openssl-0.9.8.cnf
-rw-r--r-- 1 root root 8313 Jul 13 2015 openssl-1.0.0.cnf
If I look at the openssl-1.0.0.cnf file the very first line is this comment:
# For use with easy-rsa version 2.0 and OpenSSL 1.0.0*
So it does in fact mention easy-rsa 2.0...
In earlier installations I did not touch the KEY_CONFIG line so it looked like this by default:
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`
But if I go back to those quotes I get this error message:
root@rpi3-vpn:/etc/openvpn/easy-rsa# source ./vars
**************************************************************
No /etc/openvpn/easy-rsa/openssl.cnf file could be found
Further invocations will fail
**************************************************************
I am really at a loss here, since no howto I find on the net for OpenVPN on Raspbian Stretch seems to work.
Can someone please advice as to why the openssl is not correctly configured in this case?
And of course tell me what to do to fix it....
Should I just replace the use of whichopensslcnf with this line:
export KEY_CONFIG="$EASY_RSA/openssl-1.0.0.cnf $EASY_RSA"
But of course it did not cut it:
root@rpi3-vpn:/etc/openvpn/easy-rsa# source ./vars
NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-rsa/keys
root@rpi3-vpn:/etc/openvpn/easy-rsa# ./build-ca
grep: /etc/openvpn/easy-rsa/openssl-1.0.0.cnf /etc/openvpn/easy-rsa: No such file or directory
pkitool: KEY_CONFIG (set by the ./vars script) is pointing to the wrong
version of openssl.cnf: /etc/openvpn/easy-rsa/openssl-1.0.0.cnf /etc/openvpn/easy-rsa
The correct version should have a comment that says: easy-rsa version 2.x
Finally: I removed the ending part of the export and also took out the quotes:
export KEY_CONFIG=$EASY_RSA/openssl-1.0.0.cnf
And now it actually worked to start the build-ca process!
Why in heavens name does not the whichopensslcnf script work on 2.4.0?