Skip to content
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

Set crl_check to best_effort #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/secure_coding_and_deployment_hardening/ssl.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Make sure to test the selected options against test endpoints, such as those pro

## Revocation check

One scenario that’s not handled by the above examples is certificate revocation: no revocation check is performed, and therefore a revoked but otherwise valid certificate would be accepted. It is possible to check certificates against the CA’s Certificate Revocation List (CRL) by setting the `crl_check` option to true. This also requires the `crl_cache` to be configured:
One scenario that’s not handled by the above examples is certificate revocation: no revocation check is performed, and therefore a revoked but otherwise valid certificate would be accepted. It is possible to check certificates against the CA’s Certificate Revocation List (CRL) by setting the `crl_check` option to `best_effort`. This also requires the `crl_cache` to be configured:

```erlang
%% Erlang
Expand All @@ -71,7 +71,7 @@ ssl:connect("revoked.badssl.com", 443, [
{customize_hostname_check, [
{match_fun, public_key:pkix_verify_hostname_match_fun(https)}
]},
{crl_check, true},
{crl_check, best_effort},
{crl_cache, {ssl_crl_cache, {internal, [{http, 1000}]}}}
]).
```
Expand All @@ -85,11 +85,13 @@ ssl:connect("revoked.badssl.com", 443, [
customize_hostname_check: [
match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
],
crl_check: true,
crl_check: :best_effort,
crl_cache: {:ssl_crl_cache, {:internal, [http: 1000]}}
)
```

The stricter `true` can be used instead of `best_effort`: in this case validation will fail if CRL is missing, which can happen if the certificate has no CRL or exclusively uses OCSP.

However, please note that the `ssl_crl_cache` module does not actually cache the CRL contents, so each handshake will trigger a new CRL lookup, which impacts the performance and reliability of TLS connections. In applications that require revocation checks as well as high throughput a custom CRL cache implementation will be needed.

## Selecting protocol versions and ciphers
Expand Down