Skip to content

tryTlsConnectAndReadBanner

tryTlsConnectAndReadBanner(port, bannerPrefix, options?): Promise<boolean>

Defined in: net/try-tls-connect-n-read-banner.ts:18

Connects to port over TLS, reads the first line, and returns whether it starts with bannerPrefix. Returns false on any connection or read error, or on abort.

Use with waitFor from @ac-kit/core to poll until ready:

await waitFor(() => tryReadTlsBanner(port, banner), {
signal: AbortSignal.timeout(30_000),
});

number

string

TlsSocketConnectOptions

Promise<boolean>