How to Make a VPN in Visual Basic
OpenVPN is a VPN software that was initially designed for the UNIX operating system. It is very secure, easy to use, and very portable. Later on, the OpenVPN team has also provided a Windows version which is open sourced and free software licensed under the GNU General Public License (GPL). So you can use OpenVPN on Windows too.
In this tutorial, we will show you how to make a VPN in Visual Basic so that you can use a secure connection to access the internet wherever you go on your computer.
Setting Up OpenVPN On Your System
As a first step, you will need to download and install the OpenVPN client software on your computer. There is a portable version that you can carry with you (highly recommended), and a version for Windows that you can install on your system. We will assume here that you have downloaded the portable version and installed it on a USB drive that you carry with you. If you use a version for Windows, it is highly recommended to download it to a separate partition so that you can easily reinstall it if necessary (e.g., in case your computer gets damaged or infected with a virus).
Configuring Your VPN On The Go
Once you have installed OpenVPN on your system, you need to configure it so that you can use it on the go. To do that, you need to enter the following details on your system:
- Your full name
- Your email address
- Your phone number
- The password for your account
- The port to which you want to connect (PPTP only supports a few ports)
- The country you are in
- The website you want to use for the VPN (if any)
These details will then be saved and stored on the system so that you don’t have to reenter them whenever you use the VPN.
Generating A Certificate For Your VPN
One of the first things you will need to do after configuring your VPN is to generate a certificate for it. To do that, you will need the Strong Cryptography Library, which you can download and install on your system. Once that is installed, you can use the following command to generate a certificate for your VPN:
openssl req -new -x509 -days 365 -key private/VPN_Key -out C:\temp\sample-cert.pem
This will then prompt you to enter the following information:
- Your full name: the user name you will use to access the certificate (e.g., Admin)
- Your email address: the email address you will use to notify you about the certificate (e.g., admin@example.com)
- Your phone number: the phone number you will use to identify yourself with the cert (e.g., 312-987-6543)
- The country: the country you will use to identify yourself with the cert (e.g., United States)
- The website: the website you want to use for the certificate (e.g., example.com)
- The organization: the organization you represent (e.g., Company Name)
- The organization name: the organization name you represent (e.g., Company Name)
- The city: the city you represent (e.g., London)
- The subject: the name of the person who will own the certificate (e.g., Admin)
- The password: the password you will use to encrypt the certificate (e.g., 12345)
- A new private key: if you decide later on that you don’t want to use the same key to decrypt the certificate as you used to encrypt it, you can choose this option and generate a new private key.
Activating Your VPN Once Generated
After you have generated the certificate, you will need to activate your VPN. To do that, you will enter the following details in the OpenVPN client software:
- Your full name: the user name you will use to access the certificate (e.g., Admin)
- Your email address: the email address you will use to notify you about the certificate (e.g., admin@example.com)
- Your phone number: the phone number you will use to identify yourself with the cert (e.g., 312-987-6543)
- Country you are in: the country you will use to identify yourself with the cert (e.g., United States)
- Website: the website you want to use for the certificate (e.g., example.com)
- Organization name: the organization you represent (e.g., Company Name)
- Organization: the organization you represent (e.g., Company Name)
- City: the city you represent (e.g., London)
- Subject: the name of the person who will own the certificate (e.g., Admin)
- Password: the password you will use to encrypt the certificate (e.g., 12345)
- Save this configuration file: if you decide later on that you want to change the settings of your VPN, you can choose this option and save the file to a new location.