Click here to Skip to main content
15,889,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

I have created ASP.NET C# web application and "Extended the web application to support both HTTP and HTTPS".

Http Port# 80, Https Port# 443.

What I have tried:

Now, I have created another web application and when i'm extending this to support both HTTP AND HTTPS.

I'm getting alerts that, http Port# 80 already used, so, i changed to 8080 and now what port# should i give to Https, because, Port#443 is already used.

Actually i want to know, what are the ports# we can assign to HTTP & HTTPS.


Can any one please help me.

Thanks
Posted
Updated 7-Dec-17 2:57am
v2

1 solution

As a developer, unless you're providing your own web server bundled with your application you generally want to let the System Admins handle the ports on the host machine.

As you're using ASP.NET, I'm assuming that IIS the web server. Don't put logic in place to manage ports in this instance, just logic that will refuse to send sensitive data if the port is not encrypted (!Request.IsSecureConnection).

If for some reason you've rolled your own web server, and are using 8080 for HTTP, it would logically follow to use 8443 for HTTPS. Again, though, I would suggest this only as a default and make this value configurable, since you do not know what environment your software might be operating on and local SAs might have different requirements.

The core point is that you should not be trying to manage the server. There's an SA that does this. In a perfect world, your application doesn't even understand that it's using HTTP(S), that's been abstracted away from it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900