Iinstalled Open VPN and generated .crt and .key files but I could not able to generate ta.key file which gives me options error : --tls-auth fails with ta.key : No such file or directory. How could I create this file. I couldn't find ta.key in any directory of Open VPN.
This feature by itself does not improve the TLS auth in any way, although it offers a 2nd line of defense if a future flaw is discovered in a particular TLS cipher-suite or implementation (such as CVE-2014-0160, Heartbleed, where the tls-auth key provided protection against attackers who did not have a copy). However, it offers no protection at all in the event of a complete cryptographic break that can allow decryption of a cipher-suite's traffic.
Different TA keys are already wrong here. They should be the same. Copy the server TA key to your client profile. Can you see if the certificate chain is correct? E.g. the client and server cert must be issued by the CA cert. And if the private keys are matching their public certificates?
Please notice server.crt, server.key, dh.pem and ta.key (and probably ca.crt?) goes into your server config. In your client profile, only the ca.crt and ta.key goes there. You have to fetch the client certificate and private key from your existing client profile (ovpn file).
Did it work? See my reply above yours for that tls-auth section. Since you're working on Windows.. May I suggest XCA? It's an excellent tools for managing certificates. You can use those certificates for everything were certificates is needed. Maybe internal HTTPS websites, OpenVPN server certificates, OpenVPN client certificates (for multiple users!).
Just use the generated key from your OpenWRT then. It's not related to the other certificates. When that's done, move to your client profile. Same TA key (OpenVPN static Key), same CA, and the server and key from your working client profile.
As I abandoned ios ecosystem years ago, this information might be outdated and also incorrect as I go by memory. There are two methods for importing a profile + key on ios. The simpler and less secure, and the more complicate but highly secure.
The simple one, you embed all certificate on the .ovpn file as you did with the tls. You need a computer with openssl installed so that you can extract the certificates from the .p12 file first. Than it is a matter of copy and past in the appropriate xml tags.
In the second, you first import the .p12 file in the keychain (with the extension changed to .ovpn12), and then you import the .ovpn file, but you still need to extract and embed the ca.crt in the .ovpn file. Assuming you have already embedded the tls certificate, these are the steps to follow (if my memory is correct)
Are you talking about this guide?. There are more than 3 steps. By the way, do not use those scripts in the second and third link. They are broken. You can use them to understand what are the manual steps, but do not try to use them as is because it wont work.
The links are fine, with broken I meant the script is not functioning. If you follow the procedure described in Scripted Method to create a unified .ovpn file and in iOS Keychain Method you will see that the shell code needs some fixing.
I do not have the time, but I think the ios OpenVPN page should be rewritten to describe the two methods in a way that makes clear what steps are necessary and more importantly, why. Once there is a clear description, then the shell code to do all the job in one go could be corrected. I hope to be able to do the job before my last iOS machine dies, or that someone else will create that guide. In case, I am available for help.
There is a bug that under certain conditions with a p12 with a password the insecure icon shows up as well. If you try and use it in that situation then you will get an error code as it will not require a password but the openssl command in the openvpn cgi code will be expecting one.
I am probably being especially dumb here, but the files exist for all the "No such file or directory (errno=2)" errors in the directory where systemd says they don't exist. Also, I can start openvpn server from the command line using the same configuration file. I only get the errors when trying to start the service using systemd.
A Virtual Private Network (VPN) allows you to traverse untrusted networks as if you were on a private network. It gives you the freedom to access the internet safely and securely from your smartphone or laptop when connected to an untrusted network, like the WiFi at a hotel or coffee shop.
When combined with HTTPS connections, this setup allows you to secure your wireless logins and transactions. You can circumvent geographical restrictions and censorship, and shield your location and any unencrypted HTTP traffic from untrusted networks.
OpenVPN is a full featured, open-source Transport Layer Security (TLS) VPN solution that accommodates a wide range of configurations. In this tutorial, you will set up OpenVPN on an Ubuntu 22.04 server, and then configure it to be accessible from a client machine.
Note: If you plan to set up an OpenVPN Server on a DigitalOcean Droplet, be aware that we, like many hosting providers, charge for bandwidth overages. For this reason, please be mindful of how much traffic your server is handling.
The first step in this tutorial is to install OpenVPN and Easy-RSA. Easy-RSA is a public key infrastructure (PKI) management tool that you will use on the OpenVPN Server to generate a certificate request that you will then verify and sign on the CA Server.
Once these programs are installed and have been moved to the right locations on your system, the next step is to create a Public Key Infrastructure (PKI) on the OpenVPN server so that you can request and manage TLS certificates for clients and other servers that will connect to your VPN.
These are the only two lines that you need in this vars file on your OpenVPN server since it will not be used as a Certificate Authority. They will ensure that your private keys and certificate requests are configured to use modern Elliptic Curve Cryptography (ECC) to generate keys and secure signatures for your clients and OpenVPN server.
Configuring your OpenVPN & CA servers to use ECC means when a client and server attempt to establish a shared symmetric key, they can use Elliptic Curve algorithms to do their exchange. Using ECC for a key exchange is significantly faster than using plain Diffie-Hellman with the classic RSA algorithm since the numbers are much smaller and the computations are faster.
Background: When clients connect to OpenVPN, they use asymmetric encryption (also known as public/private key) to perform a TLS handshake. However, when transmitting encrypted VPN traffic, the server and clients use symmetric encryption, which is also known as shared key encryption.
There is much less computational overhead with symmetric encryption compared to asymmetric: the numbers that are used are much smaller, and modern CPUs integrate instructions to perform optimized symmetric encryption operations. To make the switch from asymmetric to symmetric encryption, the OpenVPN server and client will use the Elliptic Curve Diffie-Hellman (ECDH) algorithm to agree on a shared secret key as quickly as possible.
Note that on your OpenVPN server there is no need to create a Certificate Authority. Your CA server is solely responsible for validating and signing certificates. The PKI on your VPN server is only used as a convenient and centralized place to store certificate requests and public certificates.
Note: If you choose a name other than server here, you will have to adjust some of the instructions below. For instance, when copying the generated files to the /etc/openvpn directory, you will have to substitute the correct names. You will also have to modify the /etc/openvpn/server.conf file later to point to the correct .crt and .key files.
In the previous step you created a Certificate Signing Request (CSR) and private key for the OpenVPN server. Now the CA server needs to know about the server certificate and validate it. Once the CA validates and relays the certificate back to the OpenVPN server, clients that trust your CA will be able to trust the OpenVPN server as well.
This option will help ensure that your OpenVPN server is able to cope with unauthenticated traffic, port scans, and Denial of Service attacks, which can tie up server resources. It also makes it harder to identify OpenVPN network traffic.
Although you can generate a private key and certificate request on your client machine and then send it to the CA to be signed, this guide outlines a process for generating the certificate request on the OpenVPN server. The benefit of this approach is that you can create a script that will automatically generate client configuration files that contain all of the required keys and certificates. This lets you avoid having to transfer keys, certificates, and configuration files to clients and streamlines the process of joining the VPN.
You will generate a single client key and certificate pair for this guide. If you have more than one client, you can repeat this process for each one. Please note, though, that you will need to pass a unique name value to the script for every client. Throughout this tutorial, the first certificate/key pair is referred to as client1.
Next, find the section on cryptographic ciphers by looking for the cipher lines. The default value is set to AES-256-CBC, however, the AES-256-GCM cipher offers a better level of encryption, performance, and is well supported in up-to-date OpenVPN clients. Comment out the default value by adding a ; sign to the beginning of this line, and then add another line after it containing the updated value of AES-256-GCM:
Next, find the line containing a dh directive, which defines Diffie-Hellman parameters. Since you configured all the certificates to use Elliptic Curve Cryptography, there is no need for a Diffie-Hellman seed file. Comment out the existing line that looks like dh dh2048.pem or dh dh.pem. The filename for the Diffie-Hellman key may be different than what is listed in the example server configuration file. Then add a line after it with the contents dh none:
3a8082e126