Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7600389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:53:55+00:00 2026-05-30T22:53:55+00:00

I have a NodeJS server running which is sucessfully acessed by 2 domains though

  • 0

I have a NodeJS server running which is sucessfully acessed by 2 domains though HTTP.

Now those 2 sites have different SSL certificates.

What I want now, is to allow those 2 sites to connect to the node server via HTTPS.

I have sucessfully added one of the certificates… How should I procede to add the other one, or in other words, add 2 certificates to the same node server?

Here’s the code I have so far:

var options = {
  key: fs.readFileSync("keys/cer1.key"),
  cert: fs.readFileSync("certs/cer2.crt"),
  ca: fs.readFileSync("ca/ca.crt")
};

https.createServer(options, function (req, res) {
  ...
}).listen(8000);

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:53:56+00:00Added an answer on May 30, 2026 at 10:53 pm

    There is a chicken and egg problem here: the server needs to decrypt the request to know which certificate to use – to decrypt the request 😉

    There is SNI which is designed to solve this – but I am not sure how that is implemented in node. Without this, you need to have a one to one mapping of port to certificate (this is the same issue every web server faces – hopefully SNI support will become the norm one day).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NodeJS TCP socket server running and I'd like to add support
I have an apache web server running on my ubuntu server box. Recently, I
Here's my problem: I have server A, running node.js and using socket.io for communicating
I have a machine running node.js (v0.1.32) with a tcp server (tcp.createServer) and a
I made the simple hello world NODEJS Server. I have a enyo web service
I'm running Nodejs and Apache alongside each other. node-http-proxy is listening on port 80
i have a case where clients connect to a node.js server running nowjs and
I have an ASP.NET 4.0 WebForms site that is running on a IIS6/Server 2003
I have an existing PHP app running on Apache server. Question, is it possible
I have a nodejs server that executes commands through child_process.exec. One such command restarts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.