Open dpb587 opened 5 years ago
cc @mhoran
I've spent several debugging sessions looking into this, but haven't made any progress. Until more users or environments run into this to make it a higher priority, I'm not going to continue spending time on it. Anyone else, please feel free!
The closest thing I can find is that, for some reason, openvpn
is not sending the RSA_SIGN
request to the management interface. In a successful connection, NEED-CERTIFICATE
is sent to the management interface before connecting to the remote OpenVPN server; then the RSA_SIGN
messages normally occurs in place of the two OpenSSL error messages which appear after the successful VERIFY
messages. In this case, NEED-CERTIFICATE
occurs, but RSA_SIGN
does not.
Seems reasonable that if openvpn
is passing an empty RSA signature to libssl
, those two errors would show up and cause a failure.
Debugging thoughts:
openvpn
from source has the same issue--management-external-key
and --management-external-cert
does not helpssoca --log-level=DEBUG openvpn exec
the management interface now logs messages it receives (recent change)ssoca openvpn exec -- --verb 9
you'll see much more debug output from openvpn
itselfnc
or a lightweight wrapper to prove/disprove openvpn
is not making the correct management calls and rule out anything with ssoca
This continues to be an issue, recently encountered by a couple other teams.
This is now happening with the latest Homebrew build of openvpn
which more people are likely to notice. Need to revisit this soon.
Spent some time investigating, but no proper explanation or resolution. Created an upstream ticket with openvpn at https://community.openvpn.net/openvpn/ticket/1216. Hopefully someone there will be able to provide more insight.
Upstream has responded acknowledging the bug:
This is from OpenSSL 1.1.1 defaulting to PSS padding (for TLS 1.2 and 1.3) which it does internally and requests a non-padded signature. But we currently have an implicit assumption that RSA signature from management will use PKCS1_RSA_PADDING. This makes it impossible to prompt for signature when 1.1.1 is in use.
There is a patch to fix this (https://patchwork.openvpn.net/patch/587/) which is under review and requires some more tweaks.
The patch was started about a year ago, but the conversation seemed to stop. It was restarted from due to the ticket, but, given its history and it requiring a management API change I would guess the change will take a while to land in an official version and then OS packages.
So, in the meantime, I've added an internal, automatic workaround for this by trying to detect the library version that openvpn
is using and then falling back to --static-certificates
-behavior for v1.1.1. The upcoming version 0.18+ should include this.
I'll keep this issue open for continued tracking of the issue.
When running
openvpn exec
, connections may fail with the following error:It appears to be related to the management interface providing signing operations because when using static certificates, it works.
This has been observed on Debian Buster and can be reproduced with the
debian:buster
image. This problem was originally misidentified as a bug with Buster's openvpn/openssl packages.As a workaround, the
--static-certificate
option can be used:For later laziness...