I installed OpenVPN on a RPi server. For sample certificates I used the command
pivpn -a, as suggested by OpenVPN. But now I want to create my own certificates because I need to insert on them an expiration date for examples.
After much research on the Internet, I didn't find anything which works, because the most of the examples provides from users are old version of OpenVPN, the only thing that I learned was that I need openSSL for creating my certificates.
So I ran the below commands for creating my certificates:
sudo openssl req -new -key ca.key > mycert.csr sudo openssl x509 -req -days 1 -in ./mycert.csr / -signkey /etc/openvpn/easy-rsa/pki/private/ca.key -out some.crt
ca.key is the key generated when I installed OpenVPN. At this point I tried to combine certificates and key such as many tutorials suggest:
client dev tun proto udp remote <my_server_ip> 1194 resolv-retry infinite nobind persist-key persist-tun remote-cert-tls server tls-version-min 1.2 verify-x509-name <server_name> name cipher AES-256-CBC auth SHA256 auth-nocache verb 3 <ca> -----BEGIN CERTIFICATE----- #my ca.crt -----END CERTIFICATE----- </ca> <cert> -----BEGIN CERTIFICATE----- #the some.crt file, which i created before -----END CERTIFICATE----- </cert> <key> -----BEGIN ENCRYPTED PRIVATE KEY----- #No idea what i have to write there -----END ENCRYPTED PRIVATE KEY----- </key> <tls-crypt> # # 2048 bit OpenVPN static key # -----BEGIN OpenVPN Static key V1----- #my ta.key -----END OpenVPN Static key V1----- </tls-crypt>
I am stuck to this point, because in the section of encrypted private key someone says that there I have to put client.key, so the key which I used for sign my certificate, but it doesn't work.
Did I mess some steps, or this is the wrong way to achieve which I want?