summaryrefslogtreecommitdiff
path: root/lib/vtls/openssl.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-11 23:00:31 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-11 23:00:31 +0200
commit2568bd0b0eb9b7a5e9d06b6c73943a597cfd99c0 (patch)
tree044ad233cf00acf942cf99acd25ed0d77ef62dd1 /lib/vtls/openssl.c
parentcffbcc3110c1eda2e333f9cfe2e269154618793a (diff)
downloadcurl-2568bd0b0eb9b7a5e9d06b6c73943a597cfd99c0.tar.gz
OpenSSL: have CURLOPT_CRLFILE imply CURLSSLOPT_NO_PARTIALCHAINbagder/partialchain-crlfile
... to avoid an OpenSSL bug that otherwise makes the CRL check to fail. Reported-by: Michael Kaufmann Fixes #5374
Diffstat (limited to 'lib/vtls/openssl.c')
-rw-r--r--lib/vtls/openssl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 6f6b604c2..a147e9980 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -2973,11 +2973,15 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
X509_V_FLAG_TRUSTED_FIRST);
#endif
#ifdef X509_V_FLAG_PARTIAL_CHAIN
- if(!SSL_SET_OPTION(no_partialchain)) {
+ if(!SSL_SET_OPTION(no_partialchain) && !ssl_crlfile) {
/* Have intermediate certificates in the trust store be treated as
trust-anchors, in the same way as self-signed root CA certificates
are. This allows users to verify servers using the intermediate cert
- only, instead of needing the whole chain. */
+ only, instead of needing the whole chain.
+
+ Due to OpenSSL bug https://github.com/openssl/openssl/issues/5081 we
+ cannot do partial chains with CRL check.
+ */
X509_STORE_set_flags(SSL_CTX_get_cert_store(backend->ctx),
X509_V_FLAG_PARTIAL_CHAIN);
}