No /openssl.cnf file could be found because of a wrong regex in whichopensslcnf

Bug #992012 reported by Munzir Taha (منذر طه) on 2012-04-30
This bug affects 30 people
Affects Status Importance Assigned to Milestone
Fix Released
easy-rsa (Ubuntu)
openvpn (Ubuntu)

Bug Description


 * Cannot create a CA or cert using easy-rsa.
 * Cannot complete the steps described in Ubuntu Server Guide:

[Test Case]
 1. After installing openvpn package, execute following commands:
    $ sudo -i
    # mkdir /etc/openvpn/easy-rsa/
    # cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa/
    # cd /etc/openvpn/easy-rsa/
    # source vars
 2. Then hit an error:
      No /etc/openvpn/easy-rsa/openssl.cnf file could be found
      Further invocations will fail
    NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-rsa/keys
 3. update the package to -proposed one
 4. verify we don't hit the error in step 2 and we can execute "./build-ca" with no error.

[Regression Potential]

 * minimal
   The patch makes last [[:alnum:]] as optional, nothing will be narrowed down.

[Other Info]

 * trusty and raring are not affected:
   - trusty has upstream fix already in easy-rsa package cut off from openvpn package.
 * quantal is also not affected:
   - quantal's openssl can be parsed without a patch.

-- original description --

/usr/share/doc/openvpn/examples/easy-rsa/2.0/whichopensslcnf contains

elif $OPENSSL version | grep -E "1\.0\.([[:digit:]][[:alnum:]])" > /dev/null; then

which won't match the openssl version in precise

$ openssl version
OpenSSL 1.0.1 14 Mar 2012

A patch to fix the issue

Changed in openvpn:
status: Unknown → New

The attachment "whichopensslcnf-patch.txt" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Simon Déziel (sdeziel) on 2012-05-01
Changed in openvpn (Ubuntu):
status: New → Confirmed
Simon Déziel (sdeziel) wrote :

@Munzir, your patch is in the wrong order. Here is a minimal patch hoping this could be SRUed.

Changed in openvpn:
status: New → Confirmed
Changed in openvpn:
status: Confirmed → Fix Released
valent (valent-turkovic) wrote :

Why am I still seeing this bug? It looks like this patch doesn't help in any way, or there was some other regresion in the mean time...

valent (valent-turkovic) wrote :

I tried editing manually both versions of whichopensslcnf, I used:

"elif $OPENSSL version | grep -E "1\.0\.[[:digit:]][[:alnum:]]?" > /dev/null; then"

but I still get missing file error:

# ./build-ca
grep: /etc/openvpn/easy-rsa/openssl.cnf: No such file or directory
pkitool: KEY_CONFIG (set by the ./vars script) is pointing to the wrong
version of openssl.cnf: /etc/openvpn/easy-rsa/openssl.cnf
The correct version should have a comment that says: easy-rsa version 2.x

Guys this is really sloppy package maintenance, this should be fixed with highest priority.

valent (valent-turkovic) wrote :

Upon further inspection here is what happens, regex now works if you use

"elif $OPENSSL version | grep -E "1\.0\.[[:digit:]][[:alnum:]]?" > /dev/null; then"

in file "whichopensslcnf"

Here is how grep regex works on the command line:
# openssl version | grep -E "1\.0\.[[:digit:]][[:alnum:]]?
OpenSSL 1.0.1 14 Mar 2012

So you need to add new elif for version 1.0.1 because there is no config file for 1.0.1, and fallback file "openssl.cnf" is missing!!!

root@vpn:/etc/openvpn/easy-rsa# ls -al *.cnf
-rw-r--r-- 1 root root 7768 Nov 2 15:28 openssl-0.9.6.cnf
-rw-r--r-- 1 root root 8325 Nov 2 15:28 openssl-0.9.8.cnf
-rw-r--r-- 1 root root 8222 Nov 2 15:28 openssl-1.0.0.cnf

valent (valent-turkovic) wrote :

Debian, CentOS and Fedora all have beside only number in vrersion also one character in version of openssl, for example:

OpenSSL 1.0.1c 10 May 2012

Why is Ubuntu missing this alphanumeric character?

Nobuto Murata (nobuto) wrote :

I will attach a debdiff for precise SRU. It looks like only precise is affected in current supported releases.

 openssl | 0.9.8k-7ubuntu8 | lucid | source
 openssl | 0.9.8k-7ubuntu8.15 | lucid-security | source
 openssl | 0.9.8k-7ubuntu8.15 | lucid-updates | source
 openssl | 1.0.1-4ubuntu3 | precise | source
 openssl | 1.0.1-4ubuntu5.11 | precise-security | source
 openssl | 1.0.1-4ubuntu5.11 | precise-updates | source
 openssl | 1.0.1c-3ubuntu2 | quantal | source
 openssl | 1.0.1c-3ubuntu2.6 | quantal-security | source
 openssl | 1.0.1c-3ubuntu2.6 | quantal-updates | source
 openssl | 1.0.1e-3ubuntu1 | saucy | source
 openssl | 1.0.1e-3ubuntu1.1 | saucy-security | source
 openssl | 1.0.1e-3ubuntu1.1 | saucy-updates | source
 openssl | 1.0.1f-1ubuntu1 | trusty | source

Nobuto Murata (nobuto) wrote :

Ubuntu Bug Squad volunteer triager

Nobuto Murata (nobuto) on 2014-02-18
description: updated
Nobuto Murata (nobuto) on 2014-02-23
Changed in easy-rsa (Ubuntu):
status: New → Fix Released
Changed in openvpn (Ubuntu):
status: Confirmed → Invalid
Changed in easy-rsa (Ubuntu Precise):
status: New → Invalid
Changed in openvpn (Ubuntu Precise):
status: New → Confirmed
Marc Deslauriers (mdeslaur) wrote :

ACK on the debdiff in #10, looks good.
I've uploaded the package to precise-proposed for processing by the SRU team.


Hello Munzir, or anyone else affected,

Accepted openvpn into precise-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at . Thank you in advance!

Changed in openvpn (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Nobuto Murata (nobuto) wrote :

I confirmed that openvpn 2.2.1-8ubuntu1.2/precise-proposed works as expected and passes the test case above.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openvpn - 2.2.1-8ubuntu1.2

openvpn (2.2.1-8ubuntu1.2) precise-proposed; urgency=low

  * d/p/lp992012-detect-openssl-properly.patch: fix "openssl.cnf file
    could be found" error using easy-rsa by parsing openssl version
    properly. (LP: #992012)
 -- Nobuto MURATA <email address hidden> Tue, 18 Feb 2014 14:35:32 +0900

Changed in openvpn (Ubuntu Precise):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for openvpn has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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