diff options
author | June McEnroe <june@causal.agency> | 2019-11-05 16:19:14 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-11-05 16:19:14 -0500 |
commit | 37217e23127a1d66d68de06a615c613fd3ac9141 (patch) | |
tree | e1e83cb027c4de3b85007c55c4883a6b545533fd | |
parent | Implement SASL EXTERNAL (diff) | |
download | pounce-37217e23127a1d66d68de06a615c613fd3ac9141.tar.gz pounce-37217e23127a1d66d68de06a615c613fd3ac9141.zip |
Use one call to set client cert and key
-rw-r--r-- | server.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/server.c b/server.c index 5ca517c..cb11d84 100644 --- a/server.c +++ b/server.c @@ -46,21 +46,10 @@ void serverConfig(bool insecure, const char *cert, const char *priv) { } if (cert) { - error = tls_config_set_cert_file(config, cert); + error = tls_config_set_keypair_file(config, cert, (priv ? priv : cert)); if (error) { errx( - EX_SOFTWARE, "tls_config_set_cert_file: %s", - tls_config_error(config) - ); - } - } - - if (cert && !priv) priv = cert; - if (priv) { - error = tls_config_set_key_file(config, priv); - if (error) { - errx( - EX_SOFTWARE, "tls_config_set_key_file: %s", + EX_SOFTWARE, "tls_config_set_keypair_file: %s", tls_config_error(config) ); } |