diff options
author | Péter Dimitrov <[email protected]> | 2019-01-10 16:39:52 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2019-01-10 16:39:52 +0100 |
commit | 4dcc43c786f790f0f2a32b268160d32499e46932 (patch) | |
tree | 8b51968e83a1db132b958566f9ff8b87df530a2a | |
parent | 27092854c046a9094ec5801b2e2179af4420272b (diff) | |
parent | 82602f666daa29717ab936014a9ec1ffa3047813 (diff) | |
download | otp-4dcc43c786f790f0f2a32b268160d32499e46932.tar.gz otp-4dcc43c786f790f0f2a32b268160d32499e46932.tar.bz2 otp-4dcc43c786f790f0f2a32b268160d32499e46932.zip |
Merge branch 'maint'
* maint:
ssl: Fix CRL suite with openssl-1.1.1a
Change-Id: I18ffe894158e8881af20bba6f6a60b85063b937c
-rw-r--r-- | lib/ssl/test/make_certs.erl | 12 | ||||
-rw-r--r-- | lib/ssl/test/ssl_crl_SUITE.erl | 7 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/ssl/test/make_certs.erl b/lib/ssl/test/make_certs.erl index 578f6a731a..76bf0fa895 100644 --- a/lib/ssl/test/make_certs.erl +++ b/lib/ssl/test/make_certs.erl @@ -189,6 +189,18 @@ gencrl(Root, CA, C, CrlHours) -> Env = [{"ROOTDIR", filename:absname(Root)}], cmd(Cmd, Env). +%% This function sets the number of seconds until the next CRL is due. +gencrl_sec(Root, CA, C, CrlSecs) -> + CACnfFile = filename:join([Root, CA, "ca.cnf"]), + CACRLFile = filename:join([Root, CA, "crl.pem"]), + Cmd = [C#config.openssl_cmd, " ca" + " -gencrl ", + " -crlsec ", integer_to_list(CrlSecs), + " -out ", CACRLFile, + " -config ", CACnfFile], + Env = [{"ROOTDIR", filename:absname(Root)}], + cmd(Cmd, Env). + can_generate_expired_crls(C) -> %% OpenSSL can generate CRLs with an expiration date in the past, %% if we pass a negative number for -crlhours. However, LibreSSL diff --git a/lib/ssl/test/ssl_crl_SUITE.erl b/lib/ssl/test/ssl_crl_SUITE.erl index 23c5eaf84d..c61039b5da 100644 --- a/lib/ssl/test/ssl_crl_SUITE.erl +++ b/lib/ssl/test/ssl_crl_SUITE.erl @@ -383,8 +383,11 @@ crl_hash_dir_expired(Config) when is_list(Config) -> {verify, verify_peer}], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), - %% First make a CRL that expired yesterday. - make_certs:gencrl(PrivDir, CA, CertsConfig, -24), + %% First make a CRL that will expire in one second. + make_certs:gencrl_sec(PrivDir, CA, CertsConfig, 1), + %% Sleep until the next CRL is due + ct:sleep({seconds, 1}), + CrlDir = filename:join(PrivDir, "crls"), populate_crl_hash_dir(PrivDir, CrlDir, [{CA, "1627b4b0"}], |