I am aware that there is a question about using https on express 3.0, however I would like to know whether there is a new method for express 4.0. Also I am interested in why you have to declare an http server and then the https server as noted on the referenced question. Also if it matters, I am using a self signed certificate.
            Asked
            
        
        
            Active
            
        
            Viewed 53 times
        
    0
            
            
        - 
                    That question is not express 3.0 specific. – Benjamin Gruenbaum Apr 12 '15 at 20:16
- 
                    Does the version of express matter? the most recent accepted answer on that question was from 2011. It is probable that there is a new and better method. – Alan Apr 12 '15 at 20:21
- 
                    Why? If you look at the answer the reason it works is because you just pass express as the callback to http.createServer , https.createServer has the same callback only you pass the certificates too. – Benjamin Gruenbaum Apr 12 '15 at 20:24
- 
                    Do you know why he even created a regular http server in the first place? – Alan Apr 12 '15 at 20:35
- 
                    To be fair, the approved answer of the linked question is not really the best solution. But there is [an answer](http://stackoverflow.com/a/14272874/2376069) below which is totally right. `https.createServer(options, app).listen(443)` is what you need. Regarding your second question: It's not necessary to run a second server on http, if node is behind a proxy like nginx. In this case nginx should redirect from http to https. – Timo Mämecke Apr 22 '15 at 21:24
 
    