Skip to content

tls_ctx_load_ca: Improve certificate error messages - #4

Closed
kdienes wants to merge 1 commit into
OpenVPN:masterfrom
kdienes:certificate-error-handling
Closed

kdienes wants to merge 1 commit into
OpenVPN:masterfrom
kdienes:certificate-error-handling

Conversation

@kdienes

@kdienes kdienes commented Jul 6, 2013

Copy link
Copy Markdown
Contributor

If a CA certificate file includes intermediate certificates, and any
of them fail to verify, the current code will file with "Cannot load
CA certificate file". Instead, generate a more specific error message
identifying the specific sub-certificate(s) which did not validate.

I make no claim that I really understand the OpenVPN code, but here's the scenario that led to this patch:

I was using the "pile of certificates" handed to me by StartSSL, and one of them was expired, but unnecessary to the verification chain. So when I tried to verify using openssl, it worked fine, but OpenVPN complained with a not-very-helpful "Cannot load CA certificate file." The following patch was what I ended up doing to figure out what was going wrong.

I have the suspicion that there are more complex procedures for submitting a patch that I don't know about, but I figured I'd start like this to see if the change was interesting enough to you for me to pursue it further.

If a CA certificate file includes intermediate certificates, and any
of them fail to verify, the current code will file with "Cannot load
CA certificate file".  Instead, generate a more specific error message
identifying the specific sub-certificate(s) which did not validate.
@ngharo

ngharo commented Aug 22, 2013

Copy link
Copy Markdown

@kdienes

kdienes commented Aug 24, 2013

Copy link
Copy Markdown
Contributor Author

Thanks very much for forwarding. I'm not on the OpenVPN lists at the
moment, but I'm happy to address issues or answer questions about the
patch if requested.

On 8/22/2013 4:14 PM, Nicholas Hall wrote:

Greetings, I just posted your patch up the openvpn-devel mailing list
@ http://article.gmane.org/gmane.network.openvpn.devel/7837

Also referenced it on the OpenVPN wiki
https://community.openvpn.net/openvpn/wiki/Patches

I'll try and update this request when I see any movement on this.

—
Reply to this email directly or view it on GitHub
#4 (comment).

@ngharo

ngharo commented Nov 15, 2013

Copy link
Copy Markdown

Good news!

Your patch has been applied to the master and release/2.3 branches.

commit 9927cdb (master)
commit 2f3c65f (release/2.3)

Author: Klee Dienes
Date: Sat Jul 6 17:00:02 2013 -0400

 tls_ctx_load_ca: Improve certificate error messages

 Acked-by: Steffan Karger <[email protected]>
 Message-Id: <CAK6ywbLVtSgRZEt4N+02fz+vQ0GNp==5KdsbqWtZ+fgUzrZq+g@mail.gmail.com>
 URL: http://article.gmane.org/gmane.network.openvpn.devel/7837
 Signed-off-by: Gert Doering <[email protected]>

lstipakov pushed a commit to lstipakov/openvpn that referenced this pull request Feb 27, 2015
…n:clp-master to clp-master

* commit 'cabc3b2acc08c3f62a8b1ebce668189c28fd4787':
  Add missing 'free' calls
@cron2

cron2 commented Feb 15, 2016

Copy link
Copy Markdown
Contributor

since it has been merged, the pull request needs closing :-)

@cron2 cron2 closed this Feb 15, 2016
cron2 pushed a commit that referenced this pull request Jul 17, 2020
To avoid keeping around a full-size openvpn.rst file which is never
needed but will take space in the repo forever, patches 01...04
of the big documentation overhaul projects were squashed togehter,
keeping the individual commit logs and URL references below.

Signed-off-by: Gert Doering <[email protected]>

* This is a combination of 4 commits.
* This is the 1st commit message:

doc/man: Add an .rst formatted version of the man page

This is the first step to move away from a manually editing g/nroff
encoded man page.

Some modifications was needed to ensure formatting was consistent and
rendered reasonably okay in GitHub and that the generated man page
(using rst2man) is looking as a proper man page.  Unsupported options
has also been moved into its own section.  HTML rendering directly
using rst2html has also been used to validate the conversion.

The rst2man and rst2html utilities comes from the python-docutils
project: https://docutils.sourceforge.io/

Signed-off-by: David Sommerseth <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063370/
Signed-off-by: Gert Doering <[email protected]>

* This is the commit message #2:

doc/man: Replace old man page with generated man page

The doc/openvpn.8 and doc/openvpn.8.html files are now being removed
from the git tree, as it will be generated from the doc/openvpn.8.rst
file using python-docutils.

An additional dist-hook is added so these files are generated
automatically when source tarballs are generated for releases.  This
means users compiling directly from the source tarball will not need
python-docutils installed.

Signed-off-by: David Sommerseth <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063373/
Signed-off-by: Gert Doering <[email protected]>

* This is the commit message #3:

doc/man: Split up and reorganize main man page

The openvpn.8.rst file is quite long and hard to edit, as it covers
several hundred options.  Some options were even documented multiple
places.  The example has also received some attention, cleaning up
old and outdated infomration.

In this commit the main man page is split up into multiple sections
and options are sorted into each of the corresponding section.
Inside each category, each option is for now sorted alphabetically.
The main openvpn.8.rst file is currently kept unchanged and will be
handled in the next commit.

Many language improvements contributed by Richard Bonhomme has also
been incorproated.

Signed-off-by: David Sommerseth <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063376/
Signed-off-by: Gert Doering <[email protected]>

* This is the commit message #4:

doc/man: Complete openvpn.8.rst splitting

This rebuilds the openvpn.8.rst content by using the text which was
split out in the previous commit by using RST ..include statements.

Signed-off-by: David Sommerseth <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063377/
Signed-off-by: Gert Doering <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants