summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/server.c b/server.c
index 1c87c2a..89e3e36 100644
--- a/server.c
+++ b/server.c
@@ -57,13 +57,24 @@ void serverConfig(bool insecure, const char *cert, const char *priv) {
 	}
 
 	if (cert) {
-		error = tls_config_set_keypair_file(config, cert, (priv ? priv : cert));
-		if (error) {
-			errx(
-				EX_SOFTWARE, "tls_config_set_keypair_file: %s",
-				tls_config_error(config)
-			);
+		const char *dirs = NULL;
+		for (const char *path; NULL != (path = configPath(&dirs, cert));) {
+			if (priv) {
+				error = tls_config_set_cert_file(config, path);
+			} else {
+				error = tls_config_set_keypair_file(config, path, path);
+			}
+			if (!error) break;
+		}
+		if (error) errx(EX_NOINPUT, "%s: %s", cert, tls_config_error(config));
+	}
+	if (priv) {
+		const char *dirs = NULL;
+		for (const char *path; NULL != (path = configPath(&dirs, priv));) {
+			error = tls_config_set_key_file(config, path);
+			if (!error) break;
 		}
+		if (error) errx(EX_NOINPUT, "%s: %s", priv, tls_config_error(config));
 	}
 
 	client = tls_client();
it/ingest.c?id=23017d58069822e4fd828f1d1908aa72cad34969&follow=1'>Track only the max client fdJune McEnroe 2019-07-28Do basic multiplexing in ingestJune McEnroe 2019-07-28Add empty commandsJune McEnroe 2019-07-28Rename ptee streamJune McEnroe 2019-07-28Remove ptee keybindsJune McEnroe 2019-07-28Import ptee from srcJune McEnroe 2019-07-28Remove old commandsJune McEnroe 2018-04-20Clean up pteeJune McEnroe 2018-04-20Uncommitted changes from months ago :(June McEnroe 2018-02-25Remove winchJune McEnroe 2018-02-25Echo at end of outputJune McEnroe 2018-02-25Add stopJune McEnroe 2018-02-25Switch back to static window sizingJune McEnroe 2018-02-25Add missing includeJune McEnroe 2018-02-25Define rules for multi-object binariesJune McEnroe 2018-02-25Rewrite everythingJune McEnroe 2018-02-22Hardcode path lengths in setupJune McEnroe 2018-02-22Add setup, start commandJune McEnroe 2018-02-22Indent list of streamsJune McEnroe 2018-02-22Add welcome message to ssh-commandJune McEnroe 2018-02-22Sleep before truncationJune McEnroe 2018-02-22List streams if none givenJune McEnroe 2018-02-22Set ForceCommand ssh-commandJune McEnroe 2018-02-22Rename command to ssh-commandJune McEnroe 2018-02-22Add command.shJune McEnroe 2018-02-22Factor out STREAM_SIZE for ingest and broadcastJune McEnroe 2018-02-22Handle EINTR from keventJune McEnroe 2018-02-22Include libutil in chroot.tarJune McEnroe