mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 16:48:27 -05:00
8c291b97b9
This adds a new `tls-client-cert-file` and `tls-client-key-file` configuration directives which make it possible to use different certificates for the TLS-server and TLS-client functions of Redis. This is an optional directive. If it is not specified the `tls-cert-file` and `tls-key-file` directives are used for TLS client functions as well. Also, `utils/gen-test-certs.sh` now creates additional server-only and client-only certs and will skip intensive operations if target files already exist.
20 lines
517 B
Tcl
20 lines
517 B
Tcl
proc rediscli_tls_config {testsdir} {
|
|
set tlsdir [file join $testsdir tls]
|
|
set cert [file join $tlsdir client.crt]
|
|
set key [file join $tlsdir client.key]
|
|
set cacert [file join $tlsdir ca.crt]
|
|
|
|
if {$::tls} {
|
|
return [list --tls --cert $cert --key $key --cacert $cacert]
|
|
} else {
|
|
return {}
|
|
}
|
|
}
|
|
|
|
proc rediscli {host port {opts {}}} {
|
|
set cmd [list src/redis-cli -h $host -p $port]
|
|
lappend cmd {*}[rediscli_tls_config "tests"]
|
|
lappend cmd {*}$opts
|
|
return $cmd
|
|
}
|