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 9201729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:05:14+00:00 2026-06-17T23:05:14+00:00

we have a node.js/express application sitting behind stunnel for ssl termination. I cannot figure

  • 0

we have a node.js/express application sitting behind stunnel for ssl termination. I cannot figure out how to force secure session cookies. looking at the session middleware source:

    // only send secure session cookies when there is a secure connection.
    // proxySecure is a custom attribute to allow for a reverse proxy
    // to handle SSL connections and to communicate to connect over HTTP that
    // the incoming connection is secure.
    var secured = cookie.secure && (req.connection.encrypted || req.connection.proxySecure);
    if (secured || !cookie.secure) {
      res.setHeader('Set-Cookie', cookie.serialize(key, req.sessionID));
    }

I apparently have to set req.connection.proxySecure to true, but I don’t know how to do that. It appears stunnel is supposed to communicate this “over HTTP”, but stunnel can’t set headers. So I am at a loss. Should I instead try to set it locally by a custom bit of middleware before the session middleware, or in a connect config variable somewhere?

Thanks for any help

  • 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-06-17T23:05:15+00:00Added an answer on June 17, 2026 at 11:05 pm

    Ensure the proxy is setting the X-Forwarded-Proto: https header. You must then to add the proxy:true config param to the session middleware.

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

Sidebar

Related Questions

We have an web application build using node js (express js), which is behind
I have a node.js Express application with a basic user authentication system where the
I have a typical web application in Node that is utilizing the Express framework
I have a node.js application using Express and Redis. My question is how do
I have built my application using node.js, mongodb, redis, express, socket.io and planning to
I have multiple Node applications (build on Express framework). Now I have placed them
I have the following express node.js app. It's using the 'redis' npm package. app.get(/test,function(req,res){
I have a JavaScript data structure like the following in my Node.js/Express web app:
I have just started studying node.js and express, the documentation of express on the
I have a node.js (v0.6.12) application that starts by evaluating a Javascript file, startup.js.

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.