RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1724034 - Unexpected OCSP in proxy SSL connection
Summary: Unexpected OCSP in proxy SSL connection
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: httpd
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: Maryna Nalbandian
URL:
Whiteboard:
Depends On:
Blocks: 1716962 1744120 1744121
TreeView+ depends on / blocked
 
Reported: 2019-06-26 06:03 UTC by Hisanobu Okuda
Modified: 2020-03-31 20:04 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1744120 1744121 (view as bug list)
Environment:
Last Closed: 2020-03-31 20:03:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
untarme.tgz (12.55 KB, application/gzip)
2019-06-26 06:04 UTC, Hisanobu Okuda
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:1121 0 None None None 2020-03-31 20:04:05 UTC

Description Hisanobu Okuda 2019-06-26 06:03:55 UTC
Description of problem:
When SSLOCSPEnable is not set and a backend server certificate has OCSP URI in AIA:

# openssl x509 -text -in /certs/newcert.pem | less
       ...
            Authority Information Access: 
                OCSP - URI:http://ocsp.hogesystems.com

OCSP access happens. If a proxy/httpd can not resolve the hostname. The error message appears in error_log:

[Wed Jun 26 05:47:41.650839 2019] [ssl:error] [pid 5054] (EAI 2)Name or service not known: [remote ::1:443] AH01972: could not resolve address of OCSP responde
r ocsp.hogesystems.com


Version-Release number of selected component (if applicable):

mod_ssl-2.4.6-89.el7_6.x86_64
httpd-2.4.6-89.el7_6.x86_64

How reproducible:


Steps to Reproduce:
1. install httpd and mod_ssl-2.4.6-89.el7_6
2. untar untar.tgz

# cd /
# tar xvf untar.tgz

3. restart httpd
4. curl http://localhost/proxy/

Actual results:
OCSP access is done.

Expected results:
OCSP access is not done.

Additional info:

This issue is caused by the code change http://pkgs.devel.redhat.com/cgit/rpms/httpd/commit/?h=rhel-7.6&id=570d29014d0f53ed9670069d2d8bcfc4d187a279 as a fix for BZ https://bugzilla.redhat.com/show_bug.cgi?id=1548501

If SSLOCSPEnable is not set, sc->server->ocsp_mask is "UNSET" = (-1) in ssl_callback_SSLVerify. -1 is 11111111111111111111111111111111 in binary:

(gdb) frame
#4  0x00007fbf5b3fc22f in ssl_callback_SSLVerify (ok=<optimized out>, ctx=0x7ffdff7b27e0) at ssl_engine_kernel.c:1433
/usr/src/debug/httpd-2.4.6/modules/ssl/ssl_engine_kernel.c:1433:53438:beg:0x7fbf5b3fc22f
(gdb) p/t sc.server.ocsp_mask
$6 = 11111111111111111111111111111111
(gdb) p/t SSL_OCSPCHECK_CHAIN
$7 = 10

Therefore, if ssl_verify_error_is_optional(errnum) == false, OCSP request will be tried at the line 1433 in ssl_engine_kernel.c

1419     if (ok && ((sc->server->ocsp_mask & SSL_OCSPCHECK_CHAIN) ||
1420          (errdepth == 0 && (sc->server->ocsp_mask & SSL_OCSPCHECK_LEAF)))) {
1421         /* If there was an optional verification error, it's not
1422          * possible to perform OCSP validation since the issuer may be
1423          * missing/untrusted.  Fail in that case. */
1424         if (ssl_verify_error_is_optional(errnum)) {
1425             X509_STORE_CTX_set_error(ctx, X509_V_ERR_APPLICATION_VERIFICATION);
1426             errnum = X509_V_ERR_APPLICATION_VERIFICATION;
1427             ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, conn, APLOGNO(02038)
1428                           "cannot perform OCSP validation for cert "
1429                           "if issuer has not been verified "
1430                           "(optional_no_ca configured)");
1431             ok = FALSE;
1432         } else {
1433             ok = modssl_verify_ocsp(ctx, sc, s, conn, conn->pool);
1434             if (!ok) {
1435                 errnum = X509_STORE_CTX_get_error(ctx);
1436             }
1437         }
1438     }


Need a code to set it to SSL_OCSPCHECK_NONE (which should be default) when it is not specified.

Comment 2 Hisanobu Okuda 2019-06-26 06:04:52 UTC
Created attachment 1584605 [details]
untarme.tgz

Comment 3 Hisanobu Okuda 2019-06-27 00:11:20 UTC
The ocsp_mask's initial value should be SSL_OCSPCHECK_NONE:

[root@e5018ace4173 ssl]# diff -u ssl_engine_config.c.org ssl_engine_config.c
--- ssl_engine_config.c.org     2019-06-27 00:07:25.590004085 +0000
+++ ssl_engine_config.c 2019-06-27 00:09:15.764960120 +0000
@@ -130,7 +130,7 @@
     mctx->auth.verify_depth   = UNSET;
     mctx->auth.verify_mode    = SSL_CVERIFY_UNSET;
 
-    mctx->ocsp_mask           = UNSET;
+    mctx->ocsp_mask           = SSL_OCSPCHECK_NONE;
     mctx->ocsp_force_default  = FALSE;
     mctx->ocsp_responder      = NULL;
     mctx->ocsp_resptime_skew  = UNSET;
[root@e5018ace4173 ssl]#

Comment 13 errata-xmlrpc 2020-03-31 20:03:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1121


Note You need to log in before you can comment on or make changes to this bug.