Skip to main content
TLSSocket.prototype.renegotiate - node__tls.d.ts - Node documentation
method TLSSocket.prototype.renegotiate

Usage in Deno

```typescript import { TLSSocket } from "node:node__tls.d.ts"; ```
TLSSocket.prototype.renegotiate(
options: { rejectUnauthorized?: boolean | undefined; requestCert?: boolean | undefined; },
callback: (err: Error | null) => void,
): undefined | boolean
The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. Upon completion, the `callback` function will be passed a single argument that is either an `Error` (if the request failed) or `null`. This method can be used to request a peer's certificate after the secure connection has been established. When running as the server, the socket will be destroyed with an error after `handshakeTimeout` timeout. For TLSv1.3, renegotiation cannot be initiated, it is not supported by the protocol.

Parameters

options: { rejectUnauthorized?: boolean | undefined; requestCert?: boolean | undefined; }
callback: (err: Error | null) => void
If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all.

Return Type

undefined | boolean
`true` if renegotiation was initiated, `false` otherwise.