Using default CA path from openssl

Hi,

first I would like to thank for the proxy ssl verification that landed
in nginx 1.7.

Regarding that, there is one slight problem Ive found, when creating a
proxy, that dynamically accesses different hosts.
The configuration is limited to setting a certificate and does not use
CA path at all.

Openssl has compiled in default where is default CA path and on some
distributions it points to system trusted CA store.

What I propose is a configuration flag, to set
SSL_CTX_set_default_verify_paths.

My not polished patch is:
— bundle/nginx-1.7.4/src/event/ngx_event_openssl.c.orig 2014-09-10
23:33:09.000000000 +0200
+++ bundle/nginx-1.7.4/src/event/ngx_event_openssl.c 2014-09-10
23:33:49.000000000 +0200
@@ -498,6 +498,7 @@
SSL_CTX_set_verify_depth(ssl->ctx, depth);

 if (cert->len == 0) {
  •    SSL_CTX_set_default_verify_paths(ssl->ctx);
       return NGX_OK;
    
    }

When there is no certificate, load defaults. That certainly has some
drawbacks. So I would propose something like
proxy_ssl_trusted_certificate system;.

What do you think? It could increase the memory load, but it is really
convenient for general ssl verification.

Other proposed solution (
Redirecting to Google Groups ) was
to export system certificates, and load them from one file.
That does not work for me, as I need to make reusable nginx
configuration, that can be deployed on many platforms and it would be
hard to instruct people how to do it.

Best,
Michal Cichra

Am 11.09.2014 00:56 schrieb Michal Cichra:

What I propose is a configuration flag, to set
SSL_CTX_set_default_verify_paths.

Careful what you wish for…

I didnt check the surrounding code, but above call and CAfile/CApath
sets (if cmd-line or via API wont matter)
has “funny” error conditions; see this post and the thread:
http://marc.info/?l=openbsd-tech&m=140646297120492&w=2

Just a 2ct heads up.

Yes, the s_client and s_server core is
There are even bugs filled

But this is different. The SSL_CTX_set_default_verify_paths does not
have a bug,
but the usage of it is wrong.

Cheers.

Hello!

On Thu, Sep 11, 2014 at 12:56:29AM +0200, Michal Cichra wrote:

Openssl has compiled in default where is default CA path and on

really convenient for general ssl verification.
Special value to load system default CA certs may make sense.


Maxim D.
http://nginx.org/