Convert .conf to .ovpn
Hello comrade. I managed to used your script and generate a file. I'm trying to connect riseup into my mikrotik router which supports to upload ovpn files. I tried to rename the .conf to .ovpn as others mentioned online but router returns an error. Amy suggestions or instructions on how I could make it work?
Hello!
Could you provide the error logs, please? I’ll look into it.
This is the message
invalid protocol value '#'
Can i get something else on Mikrotik to help you?
Could you try replacing
proto tcp
by
proto udp
in the .ovpn conf
And also try to remove all comments starting by "#" in the generated .ovpn conf
thanks comrade for the reply, after doing what you told me and trying to import it, i received this
invalid protocol value 'vpn01-sea.riseup.net'
Thanks again, it took some time to load and then gave this
error importing cert, please make sure certificate is valid and is not already imported
To explain a bit: It looks like MikroTik has its own OpenVPN implementation, so your router doesn’t support all the standard OpenVPN configuration parameters. That’s why we have to experiment a bit ^^
No problem comrade, if you want me to read any guide or something, im willing to do so. now it returns this
configuration error - missing client certificate
P.S Im copy pasting the entire thing into the generated config cause, if i rename the txt it doesnt change into ovpn
Okay, now I have no idea what to do next. You'll have to try modifying the config and experimenting on your own, I won’t be able to help you further with this one srry
But if you find a working config, I’d love to know 👍
Do you ve knowledge on Mikrotik to point me any guides?
Nope sorry I know nothing about Mikrotik 😬
The key and cert fingerprints should be different, no?
To simplify the script, I include both the certificate and the key within each <cert> and <key> block. So maybe Mikrotik doesn't understand it, lets try with this one :
Yeah this was better, this was that log gave, at the import the info was that there is a warning, but no errors appeared. This time the certificates appeared automatically, but still they are two and not three. CA and CERT are loaded. I tried to create a .key file with the fingerprint you gave me, but still couldnt import it. Another thing is that never picks a random ip, its always the one at the end of the list, should i drop some parameter in there? Another case its that at least in mikrotik? it needs auth to be sha1. I wonder maybe in terms of certificates, is there any way to combine those three into a single file? Cause when you adjust the info at the setup that provided after you import the .ovpn, at the sector of certificates it drops all the available ones and lets you pick only one, shouldnt be all of them?
device added by (*14 = /interface ovpn-client add auth=null certificate=cert_ovpn-import1743842631 cipher=aes256-gcm connect-to=89.187.173.174 disabled=yes disconnect-notify=yes max-mtu=1500 mode=ip name=ovpn-import1743842631 port=1194 protocol=udp route-nopull=no tls-version=any use-peer-dns=yes user=ovpnuser verify-server-certificate=yes)
in user importing .ovpn gives ovpnuser, is that correct? no password applicable
Sorry, I don't have a MikroTik router to test all this or to fully understand what the real issue is... Maybe you could try asking ChatGPT — it might not give you a perfect answer, but it could still help. Here's a quote from its response:
✅ Requirements:
Make sure you already have the following:
- ca.crt – the Certificate Authority file.
- client.crt – the client certificate.
- client.key – the client's private key.
- An OpenVPN server that's configured to accept connections using certificates only (no
auth-user-pass, notls-authortls-crypt).
1. 📁 Upload the certificates to the MikroTik router
You can use Winbox, WebFig, or the terminal.
Method 1: Winbox / WebFig
- Open Winbox.
- Go to
Filesand drag & drop your.crtand.keyfiles into the router.
Method 2: via SCP or FTP
scp ca.crt client.crt client.key [email protected]:/
2. 🔐 Import the certificates into MikroTik
Use the MikroTik terminal:
/certificate import file-name=ca.crt
/certificate import file-name=client.crt
/certificate import file-name=client.key
If the client.key is password-protected, MikroTik will prompt you for it. If it’s unencrypted, it will import directly.
Then verify the certificates:
/certificate print
Make sure the client cert has the flags KT (meaning it has a private key and is trusted/usable).
3. 🌐 Configure the OpenVPN client interface
Here’s an example configuration:
/interface ovpn-client add \
name=ovpn-out1 \
connect-to=your.server.ovpn.net \
port=80 \
mode=ip \
user="" \
password="" \
certificate=client.crt_0 \
auth=sha1 \
cipher=aes256 \
require-client-certificate=yes \
ca=ca.crt_0 \
disabled=no
⚠️ Important: Make sure the values for
certificate=andca=match the actual names shown in/certificate print.
4. 📡 Check if the connection is working
To view logs:
/log print where message~"ovpn"
To check the interface status:
/interface ovpn-client print
If everything is working, the interface should say “running” and you’ll have a tunnel IP.
🧪 Debug Tips:
If the connection fails:
- Check the server logs.
- The server must require client certificates (
client-cert-not-requiredmust be no).
I ll see it. Thanks brother
On Sun, Apr 6, 2025, 2:36 AM BarbossHack @.***> wrote:
Sorry, I don't have a MikroTik router to test all this or to fully understand what the real issue is... Maybe you could try asking ChatGPT — it might not give you a perfect answer, but it could still help. Here's a quote from its response:
✅ Requirements:
Make sure you already have the following:
- ca.crt – the Certificate Authority file.
- client.crt – the client certificate.
- client.key – the client's private key.
- An OpenVPN server that's configured to accept connections using certificates only (no auth-user-pass, no tls-auth or tls-crypt).
- 📁 Upload the certificates to the MikroTik router
You can use Winbox, WebFig, or the terminal.
Method 1: Winbox / WebFig
- Open Winbox.
- Go to Files and drag & drop your .crt and .key files into the router.
Method 2: via SCP or FTP
scp ca.crt client.crt client.key @.***:/
- 🔐 Import the certificates into MikroTik
Use the MikroTik terminal:
/certificate import file-name=ca.crt /certificate import file-name=client.crt /certificate import file-name=client.key
If the client.key is password-protected, MikroTik will prompt you for it. If it’s unencrypted, it will import directly.
Then verify the certificates:
/certificate print
Make sure the client cert has the flags KT (meaning it has a private key and is trusted/usable).
- 🌐 Configure the OpenVPN client interface
Here’s an example configuration:
/interface ovpn-client add
name=ovpn-out1
connect-to=your.server.ovpn.net
port=1194
mode=ip
user=""
password=""
certificate=client.crt_0
auth=sha1
cipher=aes256
require-client-certificate=yes
ca=ca.crt_0
disabled=no⚠️ Important: Make sure the values for certificate= and ca= match the actual names shown in /certificate print.
- 📡 Check if the connection is working
To view logs:
/log print where message~"ovpn"
To check the interface status:
/interface ovpn-client print
If everything is working, the interface should say “running” and you’ll have a tunnel IP.
🧪 Debug Tips:
If the connection fails:
- Check the server logs.
- The server must require client certificates ( client-cert-not-required must be no).
- Make sure TCP port 1194 is open and reachable from the MikroTik.
— Reply to this email directly, view it on GitHub https://github.com/BarbossHack/RiseupVPN-OpenVPN/issues/9#issuecomment-2781133437, or unsubscribe https://github.com/notifications/unsubscribe-auth/BM6IMD37GDZBKEODJRUNOI32YBSITAVCNFSM6AAAAAB2FWEXSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOBRGEZTGNBTG4 . You are receiving this because you authored the thread.Message ID: @.***> [image: BarbossHack]BarbossHack left a comment (BarbossHack/RiseupVPN-OpenVPN#9) https://github.com/BarbossHack/RiseupVPN-OpenVPN/issues/9#issuecomment-2781133437
Sorry, I don't have a MikroTik router to test all this or to fully understand what the real issue is... Maybe you could try asking ChatGPT — it might not give you a perfect answer, but it could still help. Here's a quote from its response:
✅ Requirements:
Make sure you already have the following:
- ca.crt – the Certificate Authority file.
- client.crt – the client certificate.
- client.key – the client's private key.
- An OpenVPN server that's configured to accept connections using certificates only (no auth-user-pass, no tls-auth or tls-crypt).
- 📁 Upload the certificates to the MikroTik router
You can use Winbox, WebFig, or the terminal.
Method 1: Winbox / WebFig
- Open Winbox.
- Go to Files and drag & drop your .crt and .key files into the router.
Method 2: via SCP or FTP
scp ca.crt client.crt client.key @.***:/
- 🔐 Import the certificates into MikroTik
Use the MikroTik terminal:
/certificate import file-name=ca.crt /certificate import file-name=client.crt /certificate import file-name=client.key
If the client.key is password-protected, MikroTik will prompt you for it. If it’s unencrypted, it will import directly.
Then verify the certificates:
/certificate print
Make sure the client cert has the flags KT (meaning it has a private key and is trusted/usable).
- 🌐 Configure the OpenVPN client interface
Here’s an example configuration:
/interface ovpn-client add
name=ovpn-out1
connect-to=your.server.ovpn.net
port=1194
mode=ip
user=""
password=""
certificate=client.crt_0
auth=sha1
cipher=aes256
require-client-certificate=yes
ca=ca.crt_0
disabled=no⚠️ Important: Make sure the values for certificate= and ca= match the actual names shown in /certificate print.
- 📡 Check if the connection is working
To view logs:
/log print where message~"ovpn"
To check the interface status:
/interface ovpn-client print
If everything is working, the interface should say “running” and you’ll have a tunnel IP.
🧪 Debug Tips:
If the connection fails:
- Check the server logs.
- The server must require client certificates ( client-cert-not-required must be no).
- Make sure TCP port 1194 is open and reachable from the MikroTik.
— Reply to this email directly, view it on GitHub https://github.com/BarbossHack/RiseupVPN-OpenVPN/issues/9#issuecomment-2781133437, or unsubscribe https://github.com/notifications/unsubscribe-auth/BM6IMD37GDZBKEODJRUNOI32YBSITAVCNFSM6AAAAAB2FWEXSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOBRGEZTGNBTG4 . You are receiving this because you authored the thread.Message ID: @.***>