我可否使用443以外的其他端口进行 HTTPS/SSL 通讯?

443端口通常用于 HTTPS/SSL。但是它是我们可以为 HTTPS/SSL 通信选择的唯一选项吗。如果没有,为什么?

156641 次浏览

The port number is not "magic", you can use any port from 1-65535 you like. There are only 2 conditions:

  1. Both the server and the client have to (agree to) use the same port number.
  2. Ports in the range 1-1023 are "well known ports" which are assigned worldwide to specific applications or protocols. If you use one of these port numbers, you may run into conflicts with the "well known" applications. Ports from 1024 on are freely useable.

As an example, you could use port 30443 for SSL VPN if your VPN gateway supports port reassignment and the SSL VPN client (if any) does this as well. If you access SSL VPN via web portal, you can add the custom port number in the URL like this: "https://mysslvpnserver.com:30443".
Beware that public internet feeds (hotels, hotspots) often block high ports > 1024.

We can use any available port for HTTPS, however, for the sake of convention, 443 and 8443 are assigned for HTTPS (browsers automatically prefix with https when these port numbers are used), but we can even run HTTPS on port 80. In this case it is our responsibility to use https (if we don't indicate it, the browser will consider it a http link).