You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.
Hello! I'm trying to reload our renewed SSL certificates without having to restart the app (Context: Reload certificate files of https.createServer() without restarting node server: nodejs/node#15115).
I'm not sure how to implement tls.createSecureContext() or tls.getSecureContext() when creating a Hapi Server.
Below is what I last tried, but I get an error in my IDE: TS2322: Type 'import("https").Server' is not assignable to type 'import("http".Server'. Property 'maxHeadersCount' is missing in type 'Server'. Is there a different server.options property I should be using?
import { Server } from 'hapi';
import * as Boom from 'boom';
import * as path from 'path'
import * as https from 'https';
import * as fs from 'fs';
import * as tls from 'tls';
import * as Loki from 'lokijs';
// ...other code...
const portNumber: 43210
const certs = tls.createSecureContext({
key: fs.readFileSync('/path/to/key.pem'),
cert: fs.readFileSync('/path/to/cert.pem'),
});
const httpsOptions = {
SNICallback: (serverName, cb) => {
cb(null, certs);
}
}
// ... other code ...
const app = new Server({
listener: https.createServer(httpsOptions), \\ TS2322 Error occurs here
port: portNumber,
routes: { cors: true },
tls: true
});
Is options.listener the right property to use for createSecureContext() or is there some other property or way to use it?
Thanks in advance for your assistance!
The text was updated successfully, but these errors were encountered:
Hello! I'm trying to reload our renewed SSL certificates without having to restart the app (Context: Reload certificate files of https.createServer() without restarting node server: nodejs/node#15115).
I'm not sure how to implement tls.createSecureContext() or tls.getSecureContext() when creating a Hapi Server.
Below is what I last tried, but I get an error in my IDE:
TS2322: Type 'import("https").Server' is not assignable to type 'import("http".Server'. Property 'maxHeadersCount' is missing in type 'Server'
. Is there a differentserver.options
property I should be using?Is
options.listener
the right property to use for createSecureContext() or is there some other property or way to use it?Thanks in advance for your assistance!
The text was updated successfully, but these errors were encountered: