![]() |
smax-clib v1.0
A C/C++ client library for SMA-X
|
TLS configuration for SMA-X. More...
Functions | |
int | smaxDisableTLS () |
int | smaxSetDHCipherParams (const char *dh_file) |
int | smaxSetMutualTLS (const char *cert_file, const char *key_file) |
int | smaxSetTLS (const char *ca_path, const char *ca_file) |
int | smaxSetTLSCiphers (const char *list) |
int | smaxSetTLSCipherSuites (const char *list) |
int | smaxSetTLSServerName (const char *host) |
int | smaxSetTLSVerify (boolean value) |
TLS configuration for SMA-X.
int smaxDisableTLS | ( | ) |
Disables a previously enabled TLS configuration for SMA-X.
int smaxSetDHCipherParams | ( | const char * | dh_file | ) |
Sets parameters for DH-based cyphers when using a TLS encrypted connection.
dh_file | Path to the DH-based cypher parameters file (in PEM format; we don't support the old DER format), or NULL for no params. |
References x_error(), X_FAILURE, X_NAME_INVALID, X_SUCCESS, and xStringCopyOf().
int smaxSetMutualTLS | ( | const char * | cert_file, |
const char * | key_file | ||
) |
Set a TLS certificate and private key for mutual TLS. You will still need to call smaxSetTLS() also to create a complete TLS configuration. Redis normally uses mutual TLS, which requires both the client and the server to authenticate themselves. For this you need the server's TLS certificate and private key also. It is possible to configure Redis servers to verify one way only with a CA certificate, in which case you don't need to call this to configure the client.
To disable mutual TLS, set both file name arguments to NULL.
cert_file | Path to the server's certificate file. |
key_file | Path to the server'sprivate key file. |
References x_error(), X_FAILURE, X_NAME_INVALID, X_SUCCESS, and xStringCopyOf().
int smaxSetTLS | ( | const char * | ca_path, |
const char * | ca_file | ||
) |
Configures a TLS-encrypted connection to thr SMA-X server with the specified CA certificate file. Normally you will want to set up mutual TLS with smaxSetMutualTLS() also, unless the server is not requiring mutual authentication. Additionally, you might also want to set parameters for DH-based cyphers if needed using smaxSetDHCypherParams().
ca_path | Directory containing CA certificates. It may be NULL to use the default locations. |
ca_file | CA certificate file relative to specified directory. It may be NULL to use default certificate. |
References TRUE, x_error(), X_FAILURE, X_NAME_INVALID, X_SUCCESS, and xStringCopyOf().
int smaxSetTLSCiphers | ( | const char * | list | ) |
Sets the TLS ciphers to try (TLSv1.2 and earlier).
list | a colon (:) separated list of ciphers, or NULL for default ciphers. |
References x_error(), X_FAILURE, X_SUCCESS, and xStringCopyOf().
int smaxSetTLSCipherSuites | ( | const char * | list | ) |
Sets the TLS ciphers suites to try (TLSv1.3 and later).
list | a colon (:) separated list of cipher suites, or NULL for default cipher suites. |
References x_error(), X_FAILURE, X_SUCCESS, and xStringCopyOf().
int smaxSetTLSServerName | ( | const char * | host | ) |
Sets the Server name for TLS Server Name Indication (SNI), an optional extra later of security.
host | server name to use for SNI. |
References x_error(), X_FAILURE, X_SUCCESS, and xStringCopyOf().
int smaxSetTLSVerify | ( | boolean | value | ) |
Sets whether to verify the the certificate. Certificates are verified by default.
value | TRUE (non-zero) to verify certificates, or else FALSE (0). |