Reputation: 477
I have server that serves as API and runs on port 8080. It must stay on 8080. I need to have it set up for HTTPS.
What confuses me everywhere it says 443 is HTTPS... I got it responding on
https://localhost:8080
and it responds from there (Express.js).
Question is did I do it correctly? Can it still be secured even though it does not run on 443? As far as I can understand, 443 and 8080 are identical in terms of technology, it's just that one is reserved for https (443) and the other one is auxiliary port 80.
So in the end, I will have client on 80, talking with API that runs on https(8080). I am sorry for these questions, but I am in a way confused with these issues :)
Upvotes: 0
Views: 250
Reputation: 11
HTTPS can run on any port. But if a secure HTTPS server listens on a port other than the standard port 443, than any URL that access your site will have to have the port explicitly declared, that is:
https://yoursite.example.com:8080/your-url
instead of
https://yoursite.example.com/your-url
which assumes that port 443 is used for HTTPS.
If you have to have your secure server running on port 8080, and your users are willing to put up with that (perhaps, because that URL is used by some application instead of human users, or is redirected), then just configure express.js to listen securely on port 8080.
Your SSL certificate might also have to be adjusted. You should check on that as well.
Upvotes: 1