Welcome! Log In Create A New Profile

Advanced

[nginx] SSL: fixed unexpected certificate requests (ticket #2008).

Maxim Dounin
June 29, 2020 05:16PM
details: https://hg.nginx.org/nginx/rev/3dcb1aba894a
branches:
changeset: 7672:3dcb1aba894a
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Jun 29 17:15:51 2020 +0300
description:
SSL: fixed unexpected certificate requests (ticket #2008).

Using SSL_CTX_set_verify(SSL_VERIFY_PEER) implies that OpenSSL will
send a certificate request during an SSL handshake, leading to unexpected
certificate requests from browsers as long as there are any client
certificates installed. Given that ngx_ssl_trusted_certificate()
is called unconditionally by the ngx_http_ssl_module, this affected
all HTTPS servers. Broken by 699f6e55bbb4 (not released yet).

Fix is to set verify callback in the ngx_ssl_trusted_certificate() function
without changing the verify mode.

diffstat:

src/event/ngx_event_openssl.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 7e0719fb528b -r 3dcb1aba894a src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c Mon Jun 15 03:58:31 2020 -0400
+++ b/src/event/ngx_event_openssl.c Mon Jun 29 17:15:51 2020 +0300
@@ -920,7 +920,8 @@ ngx_int_t
ngx_ssl_trusted_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert,
ngx_int_t depth)
{
- SSL_CTX_set_verify(ssl->ctx, SSL_VERIFY_PEER, ngx_ssl_verify_callback);
+ SSL_CTX_set_verify(ssl->ctx, SSL_CTX_get_verify_mode(ssl->ctx),
+ ngx_ssl_verify_callback);

SSL_CTX_set_verify_depth(ssl->ctx, depth);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] SSL: fixed unexpected certificate requests (ticket #2008).

Maxim Dounin 65 June 29, 2020 05:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 46
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready