mirror of
https://github.com/fluencelabs/redis
synced 2025-06-23 22:11:33 +00:00
TLS: Improve CA certifiate configuration options.
This adds support for explicit configuration of a CA certs directory (in addition to the previously supported bundle file). For redis-cli, if no explicit CA configuration is supplied the system-wide default configuration will be adopted.
This commit is contained in:
@ -125,8 +125,8 @@ int tlsConfigure(redisTLSContextConfig *ctx_config) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!ctx_config->ca_cert_file) {
|
||||
serverLog(LL_WARNING, "No tls-ca-cert-file configured!");
|
||||
if (!ctx_config->ca_cert_file && !ctx_config->ca_cert_dir) {
|
||||
serverLog(LL_WARNING, "Either tls-ca-cert-file or tls-ca-cert-dir must be configured!");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -182,9 +182,9 @@ int tlsConfigure(redisTLSContextConfig *ctx_config) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (SSL_CTX_load_verify_locations(ctx, ctx_config->ca_cert_file, NULL) <= 0) {
|
||||
if (SSL_CTX_load_verify_locations(ctx, ctx_config->ca_cert_file, ctx_config->ca_cert_dir) <= 0) {
|
||||
ERR_error_string_n(ERR_get_error(), errbuf, sizeof(errbuf));
|
||||
serverLog(LL_WARNING, "Failed to load CA certificate(s) file: %s: %s", ctx_config->ca_cert_file, errbuf);
|
||||
serverLog(LL_WARNING, "Failed to configure CA certificate(s) file/directory: %s", errbuf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user