@marcoblom Encrypting the client key is not required, but is highly recommended, and if it's a client key for an Android device, the key must me encrypted, as Android has a non-customizable 771 permission structure for user land storage.
I'm not sure why it wouldn't be creating the the CSR for the client, as the command that's being ran is:
# Generating Client Cert & Key
openssl req -batch -new -keyout "vpnclient.key" -out "vpnclient.csr" -subj "/CN=vpnclient" -config "$PKI_CONF"
# Signing Client Cert
openssl ca -batch -keyfile "ca.key" -cert "ca.crt" -in "vpnclient.csr" -out "vpnclient.crt" -config "$PKI_CONF" -extensions "vpnclient"
Please run the following script, do not encrypt the first client cert, but do encrypt the second.
#!/bin/sh
CSR="/tmp/csr-output"
PKI_CONF="$PKI_DIR/openssl.cnf"
PKI_DIR="/tmp/ossl"
mkdir -p "$PKI_DIR"
chmod -R 600 "$PKI_DIR"
cd "$PKI_DIR"
touch index.txt index
echo 10000 > serial
cp -f /etc/openvpn/ssl/openssl.cnf "$PKI_DIR"
printf "\nCreating CA...\n"
openssl req -batch -nodes -new -keyout "ca.key" -out "ca.crt" -x509 -config "$PKI_CONF" -days "3650"
printf "\nCreating Unecnrypted Client Key...\n\n"
printf %b " DO NOT ENCRYPT this client key...\n\n"
openssl req -batch -new -keyout "vpnclient1.key" -out "vpnclient1.csr" -subj "/CN=vpnclient" -config "$PKI_CONF"
openssl ca -batch -keyfile "ca.key" -cert "ca.crt" -in "vpnclient1.csr" -out "vpnclient1.crt" -config "$PKI_CONF" -extensions "vpnclient"
printf "\nCreating Encrypted Client Key...\n\n"
printf %b " DO ENCRYPT this client key...\n"
openssl req -batch -new -keyout "vpnclient2.key" -out "vpnclien2.csr" -subj "/CN=vpnclient" -config "$PKI_CONF"
openssl ca -batch -keyfile "ca.key" -cert "ca.crt" -in "vpnclient2.csr" -out "vpnclient2.crt" -config "$PKI_CONF" -extensions "vpnclient"
printf "\nPlease post the output of /tmp/csr-output in forum reply IF receiving CSR error"
printf %b" # vpnclient1.csr #\n\n"
openssl req -in vpnclient1.csr -noout -text > $CSR
printf "\n\n\n" >> $CSR
printf %b" # vpnclient2.csr #\n\n"
openssl req -in vpnclient2.csr -noout -text >> $CSR