-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurations using --pkcs12 for key/cert/ca are not working #25
Comments
Can you first try to start this configuration using the Just try this first:
The |
Thanks for the quick reply! When I use I've checked (using |
You need the Python 3 packaging for these dependencies. So check for |
Btw, are you installing OpenVPN 3 Linux from the apt repositories, or have you done a build yourself? Details here: https://community.openvpn.net/openvpn/wiki/OpenVPN3Linux |
From the APT repositories. I followed the instructions from that page, under "Pre-built packages" -> "Debian, Ubuntu".
I actually mapped Now there seems to be an incompatibility of some sort in my config file. The new error message is:
|
In regards to
Ouch! That's not your fault. That's actually something missing in the config parser in the openvpn3 python module. Okay, so this approach didn't work as smooth as it usually does. Lets go to plan B. Have two terminals handy. In the first one, we will start a process watching for logs:
In the second terminal, run this:
(the |
Output of
Output of
|
Okay, this makes it a bit clearer. It's the If you feel adventurous doing some debugging on your own in the meantime, have a look here: https://github.com/OpenVPN/openvpn3-linux/blob/master/docs/debugging.md ... The best is if you are able to enable and track down some coredumps or a backtrace of the crash, but I don't quite remember how that works on Ubuntu. |
I've managed to install |
Good! So I've put together a pretty simple debug helper script in Python. First, you need to import the configuration profile you want to test with. This debug script does not support configurations requiring username/passwords. If your config requires that, let me know and I'll expand this script to provide this information as well. First, import the configuration profile:
Then save the script below:
To use this script, let's say you named it
Do what this script instructs you to do, and hit [ENTER]. It is important that you run |
Thanks for the very extensive instructions! The connection does indeed require username & password however... |
No worries, here's an updated debug script which will expect user credentials to be provided:
|
Here we go. The output of the debug script:
The |
Wow! That's interesting! But at least now we have an error which makes some sense. And there more issues being triggered in parallel. The trigger point is here:
The Could you try to run this config against the classic OpenVPN 2.x and see if that behaves as expected? |
I believe I did this, before we went through the debugging route: #25 (comment) I got this error then, and the same now:
I don't think I can run |
Ahh, the |
I wasn't aware. My apologies! With |
Alright, so the configuration file is not corrupt. I'll run some more testing with |
This comment has been minimized.
This comment has been minimized.
This is confusing. This issue is not about running OpenVPN 3 Linux in Docker. In addition, you talk about This issue is about PKCS12 files not being handled correctly in the OpenVPN 3 Python module. Please stay on topic within in the issue tickets. |
PLEASE STAY ON TOPIC - THIS IS ABOUT PKCS12 CERTIFICATE/PRIVATE KEY BUNDLES |
Was there ever any progress on this? I'm having the exact same issues and identical errors when trying the debug steps in previous comments. I can also connect using openvpn but not openvpn3. It may be coincidence, but I had a router failure and this issue started after I replaced it -- however I tried purging/reinstalling both openvpn and openvpn3 (via apt) as well as removing and re-adding my configs after fixing the router and neither had any effect. I am on Ubuntu 20.04. |
@benfreefly Does your configuration profile contain |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
To the next commenterHave you read carefully the initial issue comment? Have you verified your configuration does contain |
From @dsommers comment.
using Thanks 👍 |
I wrapped together a quick Python script now, which can import configuration profiles (a variant of #!/usr/bin/python3
#
# OpenVPN 3 Linux client -- Next generation OpenVPN client
#
# SPDX-License-Identifier: AGPL-3.0-only
#
# Copyright (C) 2017 - 2023 OpenVPN Inc <[email protected]>
# Copyright (C) 2017 - 2023 David Sommerseth <[email protected]>
#
#
# Another Python implementation of importing a configuration profile.
# This approach uses the openvpn3 Python to get a real configuration
# profile to use for the import (via the openvpn3.ConfigParser) and
# imports it using the openvpn3.ConfigurationManager.
#
# Use this as: ./configimport2.py CONFIG_NAME <openvpn 2 options>
# Example: ./configimport2.py my-config --config /path/to/config.ovpn --verb 6
#
import dbus
import openvpn3
import sys
# Simple argument pre-checks
if sys.argv[1] in ['--help','-h']:
openvpn3.ConfigParser(sys.argv, 'Imports a configuration profile')
sys.exit(0)
if len(sys.argv) < 3:
print('** ERROR ** Too few arguments')
print('Usage: %s CONFIG_NAME <openvpn options....>')
sys.exit(1)
# Parse the configuration
config_name = sys.argv[1]
parser_args = [sys.argv[0],] + sys.argv[2:]
cfgparser = openvpn3.ConfigParser(parser_args, 'Imports a configuration profile')
cfgparser.SanityCheck()
config_profile = cfgparser.GenerateConfig()
# Get a connection to the system bus
bus = dbus.SystemBus()
# Get a connection to the OpenVPN 3 Configuration Manager
config_mgr = openvpn3.ConfigurationManager(bus)
# Import the configuration as a multi-use, persistent configuration profile
config = config_mgr.Import(config_name, config_profile, False, True)
print('Configuration "%s" imported' % config_name)
print('Configuration path: ' + config.GetPath()) This will appear as |
READ THIS CAREFULLY BEFORE ADDING A NEW COMMENT
Does your configuration file use the
pkcs12
option? If yes, continue. If not, this issue ticket is not your problem - look up another issue or file a new one.Can you try starting the session using the
openvpn2
command line front-end? If that does not work, this issue ticket is not your problem - look up another issue or file a new one.If you still do not know if your issue is related to the
pkcs12
option, search forpkcs12
in the configuration you have?a) Have you imported your configuration using
openvpn3 config-import
or do you useopenvpn3-autoload
? Run this command:If this returns nothing, this issue ticket is not your problem - look up another issue or file a new one.
If you do not know your
$CONFIG_NAME
, runopenvpn3 configs-list
and see if you find it there.b) If you have your OpenVPN client configuration file saved as a file, run this command:
If this returns nothing, this issue ticket is not your problem - look up another issue or file a new one.
If you have discovered that your configuration file does make use of the
pkcs12
option, then you can continue reading. Otherwise, this issue ticket is not your problem - look up another issue or file a new one.I set up a clean install of OpenVPN 3 client on my Ubuntu 18.04 machine. When I run:
I get the following error:
This configuration file contains a PKCS#12 file with valid client/ca certs and private key.
Can anyone help figure out what is going wrong here?
The text was updated successfully, but these errors were encountered: