I am working on my application where I use passport for authentication.
One of the providers required my application to be on https so I implemented self assigned ssl and run my server on HTTPS . Server runs okay, however app.use(passport.initialize()) is not working anymore. It was working perfectly fine on HTTP protocol but it won't work with ssl . I tried every single solution I found on the internet but it just won't work. I even switched back to http to see if it is working and it does, but when I switch back, it just won't work. I need my req.user on my endpoints and without passport.initialize() it won't deserialize and assign value to req.user. So far, req.user is undefined.
I got all passport methods in order (before router) and passport.initialize() method before passport.sessions() .
Sessions seem to work as usual. I get req.session object normally.
It is just not using app.use(passport.initialize()) on HTTPS .