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 1476032 - Use Of /etc/pki/tls/cert.pem By OpenSSL Is Undocumented In Man Pages.
Summary: Use Of /etc/pki/tls/cert.pem By OpenSSL Is Undocumented In Man Pages.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssl
Version: 7.7
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-27 21:54 UTC by Bernie Hoefer
Modified: 2019-12-24 22:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-11 15:41:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Output of "openssl s_client" commands demonstrating the problem. (2.89 KB, text/plain)
2017-07-27 21:55 UTC, Bernie Hoefer
no flags Details

Description Bernie Hoefer 2017-07-27 21:54:05 UTC
Description of problem:

According to "man s_client" page, the use of the "-verify" option should enable server certificate verification.

I attempted to verify a server's certificate using a CAfile I knew was incorrect, fully expecting the verification to fail.  It did not!  I also attempted the same *without* specifying the "-CAfile" or "-CApath" options.  Again, the server's certificate verified successfully!

I wasted much time trying to figure out why my tests were always verifying the server's certificate successfully, despite what the man page stated.  I ultimately learned that openssl was silently using /etc/pki/tls/cert.pem as a CAfile.  This is not documented in the man pages for s_client, openssl or verify.


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

openssl-1.0.1e-60.el7_3.1.x86_64


How reproducible:

See attached text file.


Actual results:

Server's certificate verifies successfully.


Expected results:

Server's certificate should not verify.


Additional info:

The silent use of /etc/pki/tls/cert.pem as a CAfile prohibits one from using OpenSSL to test certificate chains.  Even though I was originally specifying my own CAfile in the "openssl s_client" command, it always verified the server's certificate no matter what -- even when I explicitly used a wrong certificate file in the "-CAfile" option!  That is unexpected and incorrect.

I'm guessing the silent use of the /etc/pki/tls/cert.pem file was done to make openssl more `user friendly`.  I disagree with that, but if that feature is to remain, then the following should happen:

1.  It should be documented in the man pages!

2.  There should be a way to disable it from the command line.

3.  It should automatically be disabled if the user uses the "-CAfile" or "-CApath" options in his/her command.

Thank you.

Comment 2 Bernie Hoefer 2017-07-27 21:55:13 UTC
Created attachment 1305663 [details]
Output of "openssl s_client" commands demonstrating the problem.

Comment 3 Simo Sorce 2019-02-11 15:41:12 UTC
This issue was not selected to be included either in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small amount of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available. We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.

Comment 4 Paul Donohue 2019-12-24 22:55:20 UTC
It looks like this has been fixed in OpenSSL 1.1.0:
https://github.com/openssl/openssl/commit/7e1b7485706c2b11091b5fa897fe496a2faa56cc#diff-7f3b79983f6d53c047c90a62813cc11fL1355

With OpenSSL 1.1.0, use `openssl s_client -CAfile <file> -no-CApath ...`

With OpenSSL 1.0.2, you can work around this using: `SSL_CERT_FILE= SSL_CERT_DIR= openssl s_client -CAfile <file> ...`


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