OpenVPN fails to start/connect: OpenSSL: error:0A00018E:SSL routines::ca md too weak

Bug #1968629 reported by Marcus Sundman
This bug report is a duplicate of:  Bug #1975574: OpenSSL 3.0 support in OpenVPN 2.5. Edit Remove
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
openvpn (Ubuntu)
Triaged
High
Unassigned

Bug Description

After upgrading to jammy OpenVPN doesn't work anymore. The error message just says "VPN connection 'myvpn' failed to activate." and that the VPN service has stopped. Replacing openvpn 2.5.5 with 2.5.1 from impish it works again.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: openvpn 2.5.5-1ubuntu3
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
ApportVersion: 2.20.11-0ubuntu80
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
Date: Tue Apr 12 00:45:42 2022
InstallationDate: Installed on 2013-11-27 (3057 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
SourcePackage: openvpn
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Marcus Sundman (sundman) wrote :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Hi Marcus,

Thanks for taking the time to file this bug and trying to make Ubuntu better.

With the information you provided is hard to predict what is happening in your system. Could you share any information/config files/steps to reproduce this issue? Otherwise we cannot act on this bug.

I am setting the status of this bug to Incomplete, once you provide more information set it back to New and we will take a look again.

Changed in openvpn (Ubuntu):
status: New → Incomplete
Revision history for this message
Marcus Sundman (sundman) wrote (last edit ):

Obviously I can't give you credentials to our VPN, but what other information (besides the already attached files) would be useful? I'll upload the part of syslog where I connect successfully with impish openvpn and when I try to connect unsuccessfully with jammy openvpn. Maybe that helps.

Revision history for this message
Marcus Sundman (sundman) wrote :
Revision history for this message
Marcus Sundman (sundman) wrote :
Changed in openvpn (Ubuntu):
status: Incomplete → New
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thank you for providing further info, Marcus. This is exactly what we needed in order to continue the investigation.

The following line from the Jammy log file caught my attention:

Apr 13 00:50:01 slim nm-openvpn[3337388]: OpenSSL: error:0A00018E:SSL routines::ca md too weak

This is the reason OpenVPN is failing to connect. This error happens because OpenSSL 3.0 (which is the default OpenSSL version in Jammy) now rejects certificates generated with legacy cryptographic algorithms, which seems to be what you have there. See:

https://wiki.openssl.org/index.php/OpenSSL_3.0#Legacy_Algorithms

The recommended fix for this issue is to regenerate your certificates using stronger ciphers. There are other workarounds available, but they are unsafe and IMHO shouldn't be used in production. I am leaving a few links here that contain interesting discussions about this error:

https://www.snbforums.com/threads/default-openvpn-server-no-longer-works-with-openssl-3.75192/
https://github.com/openssl/openssl/issues/16650
https://forums.openvpn.net/viewtopic.php?t=23979 (old, but seems to be still applicable)

Having said all that, it looks very much like this is a local configuration issue rather than a bug in the package, so I am marking the bug as Incomplete again. If you still believe this is a problem with the openvpn, please mark this bug as New and provide a rationale for us.

Thanks.

Changed in openvpn (Ubuntu):
status: New → Incomplete
Revision history for this message
Arne Schwabe (arneschwabe) wrote :

To make this configuration with OpenSSL 3.0 and OpenVPN you need

 tls-cert-profile insecure

which is not included in OpenvPN 2.5.5 in Ubuntu. The upstream commit is

https://github.com/OpenVPN/openvpn/commit/7b1b100557608db8a311d06f7578ceb7c4d33aa6

Revision history for this message
Paride Legovini (paride) wrote :

Thanks Arne for chiming in and for pointing at that patch, which according to [1] has been tested against Ubuntu 22.04 already.

I was worried about introducing a patch in Ubuntu can possibly downgrade the OpenVPN security standards, but I see that the same change landed in the master branch [2], so we're going to ship it with the next Ubuntu releases anyway (as part of newer OpenVPN releases), so I think it's safe to include after all.

[1] https://<email address hidden>/msg24273.html
[2] https://github.com/OpenVPN/openvpn/commit/23efeb7a0bd9e0a6d997ae6e77e0e04170da3e67

summary: - OpenVPN fails to start/connect
+ OpenVPN fails to start/connect: OpenSSL: error:0A00018E:SSL routines::ca
+ md too weak
tags: added: server-next
Changed in openvpn (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → High
Revision history for this message
Bryce Harrington (bryce) wrote :

Attached is the patch in question (untested).

Like Paride and Sergio, I also think the ideal fix is for users to improve their certificates with stronger ciphers, but presumably they have no admin authority on the systems they're connecting to, so don't really have that option. However, this patch just adds an option to workaround the situation, and as Paride points out it this is upstream as of May 4th, and thus may already be in the 2.6.0~git20220518+dco-2ubuntu1 version currently in kinetic-proposed, so it may indeed be viable for SRU consideration.

Anyone have a guess as to how widespread these outdated VPN certs are? Knowing that would help inform the severity to communicate in the SRU Impact statement.

Revision history for this message
Bryce Harrington (bryce) wrote :

Also, if anyone can suggest a paint-by-numbers way to reproduce this issue and test the fix, that would help in getting the SRU crafted and accepted for release.

tags: added: patch
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

This and other fixes related to OpenSSL 3 were reported by OpenVPN upstream maintainer here:

https://bugs.launchpad.net/ubuntu/+source/openvpn/+bug/1975574

We will try to backport all the mentioned patches to Jammy.

Robie Basak (racb)
tags: added: server-todo
removed: server-next
Changed in openvpn (Ubuntu):
assignee: nobody → Sergio Durigan Junior (sergiodj)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Let us try to prep all the ssl3 changes that got found.

Changed in openvpn (Ubuntu):
assignee: Sergio Durigan Junior (sergiodj) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.