Bug 1363844

Summary: openvpn@.service ignores Environment setting in drop-in file
Product: [Fedora] Fedora Reporter: styxd6
Component: systemdAssignee: David Sommerseth <dazo>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: dazo, gwync, huzaifas, johannbg, lnykryn, msekleta, muadda, ssahani, s, steve, systemd-maint, zbyszek
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 16:12:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description styxd6 2016-08-03 17:33:14 UTC
Description of problem:
I need to connect to a VPN network which, unfortunately, is still using MD5-signed certificate. In Fedora 23, I have crated a drop-in file md5.conf:

$ systemctl status openvpn
● openvpn - OpenVPN Robust And Highly Flexible Tunneling Application On xxxx
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/openvpn.d
           └─md5.conf
   Active: inactive (dead)

The drop-in sets the environment for the service:

[Service]
Environment=OPENSSL_ENABLE_MD5_VERIFY=1

In Fedora 23, this setup was working fine. In Fedora 24, this fails as if MD5 verification was not enabled.


Version-Release number of selected component (if applicable):
openvpn-2.3.11-1.fc24.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Configure openvpn to connect to a network using a certificate with MD5 signature.
2. Enable MD5 support in OpenSSL via [Service]/Environment setting.
3. Start the service and observe its logs.

Actual results:
openvpn refuses to connect as when OPENSSL_ENABLE_MD5_VERIFY=1 is not set.

Expected results:
openvpn should connect to the VPN network.

Additional info:
When running openvpn as:

$ env OPENSSL_ENABLE_MD5_VERIFY=1 openvpn /etc/openvpn/xxxx.conf

the connection is established without any issue. This problem must be either in the service file provided with openvpn in Fedora 24, or has something to do with systemd.

Comment 1 David Sommerseth 2016-08-03 18:03:47 UTC
Hi,

This issue is not related to OpenVPN at all.  OpenVPN depends completely on the SSL library to take care of the SSL/TLS layer, which includes the certificate validation.  So when OpenVPN doesn't accept a certificate, it is due to OpenSSL not accepting it.  And when you set the OPENSSL_ENABLE_MD5_VERIFY env. variable, it is the OpenSSL library picking up that value and not anything OpenVPN understands at all.

I see three possible solutions:

a) Get a new SHA based certificate as a replacement for the MD5 (the recommended 
   solutions)

b) Build your own OpenSSL (or mbedTLS/PolarSSL) library and rebuild OpenVPN from 
   scratch with the proper settings to allow MD5

c) Re-open this bz and re-file it to the OpenSSL people and see if they can do 
   something (most likely not)

Comment 2 styxd6 2016-08-03 18:47:10 UTC
Hi,

Please, consider that when invoked from command line, openvpn does catch the environment variable correctly, as I've noted.

The problem seems not with the openvpn program, but rather with openvpn@.service unit file - which is provided by the openvpn package, which is why I filed the bug against openvpn. Either that, or it's a problem in systemd.

Since this was dismissed, I'll re-file the bug to systemd. OpenSSL doesn't seem to be related to the problem, since by the time the library is called the environment variable has already failed to be exported by the systemd service.

Comment 3 Zbigniew Jędrzejewski-Szmek 2016-08-04 05:25:05 UTC
Hm, it seems to work fine here (in the sense that the environment variable is set in the service process properly). Which version of systemd are you using exactly? 

There's been a similar report about Environment not being propagated correctly, but I cannot reproduce the error, so either it's some subtle error in the configuration, or I'm missing some step to properly reproduce this. Maybe somebody who sees this will be able to debug.

Comment 4 styxd6 2016-08-09 18:21:46 UTC
Hello

This is the output of systemctl --version

systemd 229
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN

I'm using the current Fedora 24 version.

Comment 5 Fedora End Of Life 2017-07-25 22:14:16 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2017-08-08 16:12:17 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.