From 5c272fb858ab9ac7bed3f791116a4211b3ba39d8 Mon Sep 17 00:00:00 2001 From: Alan Doherty Date: Wed, 24 Mar 2021 20:38:23 +0000 Subject: [PATCH] Use connection host if TLS options host not specified (#179) --- src/Client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Client.ts b/src/Client.ts index 4a43eed..4f556c8 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -263,7 +263,9 @@ export class Client { welcome = await this.connect(options.host, options.port) } if (useExplicitTLS) { - await this.useTLS(options.secureOptions) + let secureOptions = options.secureOptions || {} + secureOptions.host = secureOptions.host || options.host + await this.useTLS(secureOptions) } await this.login(options.user, options.password) await this.useDefaultSettings()