Skip to content

Change ssl certificate without dropping connections #868

Description

@abhay-s-rawat

Hi , I am using uWebSockets.js with socketio and I was searching for way to update ssl certificate when ssl renews without restarting server. Like its done with httpserver. I can use filewatcher to know if certificate is renewed, can you please tell how to change in uWebSockets.js.

httpServer.setSecureContext(
{
  key: fs.readFileSync(settings.PRIVKEY),
  cert: fs.readFileSync(settings.FULLCHAIN)
});
const { SSLApp } = require("uWebSockets.js");
const { Server } = require("socket.io");

const app = new SSLApp({
  key_file_name: "keys/server_key.pem",
  cert_file_name: "keys/server_cert.pem",
});
const io = new Server({ transports: ["websocket"] });
io.attachApp(app);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions