-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Periodically reload verify cert store (stable) #1186
Periodically reload verify cert store (stable) #1186
Conversation
This triggers a reload of the cert store used for chain building and certificate verification (CRLs) once an hour.
Also add a few comments about the usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the version check, it looks good.
// so we simply rely on the global one in SSL_CTX. The latter | ||
// doesn't refresh the verify store, which causes issues with some | ||
// plugins. | ||
#if OPENSSL_VERSION_NUMBER >= 0x010100000L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not so fast, the test should be '>' not '>=' because OpenSSL 1.01 does not have the set1 functions. I know from your comment that you did compile it on SL6 but that only worked because someone must have upgraded their OpenSSL (which of course they should have). Unfortunately, lots of sites use RH6 out of the box and it comes with 1.0.1e-fips and it definitely won't compile! I think all of teh test should change and hen you'll be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this?
OPENSSL_VERSION_NUMBER >= 0x010100000L
should test for 1.1.0 or later. That is, it only enables this code if you are at least on 1.1.0 -- that should exclude any variant of RHEL6.
(FWIW - the OpenSSL RPM I tested against was openssl-1.0.1e-58.el6_10.x86_64
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it is intentional, but it will also exclude any variant of RHEL7, as e.g. both Centos7 and CC7 have openssl 1.0.2k
. From what I see SSL_set1_verify_cert_store
& SSL_set1_chain_cert_store
are available in OpenSSL 1.0.2 (see e.g. https://github.com/openssl/openssl/blob/OpenSSL_1_0_2k/ssl/ssl.h). If we would like to include RHEL7 we should test for OPENSSL_VERSION_NUMBER >= 0x10002000L
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh - sorry, I haven't been able to sit down and get to this in the last two days (which have each had >6hrs of Zoom meetings...). You're right, this is too strict.
// Initialize a store for use on individual SSL objects and schedule | ||
// a periodic update. These separate stores are only usable on versions | ||
// of OpenSSL 1.1.0 or later. | ||
#if OPENSSL_VERSION_NUMBER >= 0x010100000L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Not to worry, we will appropriately change it.
…On Thu, 30 Apr 2020, Brian P Bockelman wrote:
@bbockelm commented on this pull request.
> @@ -633,6 +635,19 @@ int XrdHttpProtocol::Process(XrdLink *lp) // We ignore the argument here
sbio = CreateBIO(Link);
BIO_set_nbio(sbio, 1);
ssl = SSL_new(sslctx);
+
+ // On newer versions of OpenSSL, we use the periodically
+ // updated store `verify_store` with the `x509_store_lock`
+ // held; older OpenSSL versions are missing `SSL_set1_*_cert_store`,
+ // so we simply rely on the global one in SSL_CTX. The latter
+ // doesn't refresh the verify store, which causes issues with some
+ // plugins.
+#if OPENSSL_VERSION_NUMBER >= 0x010100000L
Argh - sorry, I haven't been able to sit down and get to this in the last two days (which have each had >6hrs of Zoom meetings...). You're right, this is too strict.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#1186 (comment)
|
Already done: 5c73add |
This is a backport of #1183 (plus some
#ifdef
's so it can compile on SL6).This uses a per-SSL-object certificate store (shared via ref counts) in order to provide verification functions. A helper task periodically loads a fresh copy of the cert store.