Skip to content

Instantly share code, notes, and snippets.

View borun's full-sized avatar

Md Abdullah Al Farooq borun

View GitHub Profile
@borun
borun / openvpn_gen.py
Last active April 14, 2025 13:29 — forked from Justasic/openvpn_gen.py
This is a python script to generate client OpenVPN configuration files. This is based mostly on the easyrsa script and is much simpler to understand.
# Many features of pyOpenSSL package are depricated. So we are using the cryptography library instead.
# pip install cryptography
from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.serialization import Encoding, PrivateFormat, NoEncryption
from cryptography.hazmat.primitives import serialization # Fix: Import serialization
from datetime import datetime, timedelta, UTC # Fix: Import datetime and timedelta