Default port used by Chrome when accessing a website

14,972 views
Skip to first unread message

Girish Arora

unread,
Sep 1, 2019, 12:55:25 PM9/1/19
to Chromium OS Discussion
Hello All,

I have been doing some research about how does the browser gets to know which port its going to use when you first access a website? Suppose I have a Vanilla machine and I access the URI google.com (without any www or protocol identifier http/https), how does the browser gets to know which port its going to make a connection to? Note that this is the first time I am accessing google.com from browser no HSTS is out of the picture.

If you look at a Packet capture when you access a website, it shows DNS happening and after that the TCP Handshake. For DNS, chrome will send a DNS Query on port 53. But for a TCP Handshake, which port will Chrome browser try first? 80 or 443? Also let's say I run a Non Secure website with HTTPS like https://www.nossl.com. In this scenario, I am explicitly telling the browser to first go to 443 and in tcp handshake I think I will see failover happening from 443 to 80 as server would not open up a connection on 443. Am I right?

Thanks in advance for your help.

Nom De Plume

unread,
Sep 1, 2019, 1:38:26 PM9/1/19
to Chromium OS Discussion
There will be a firewall in front of most websites. If port 80 is opened and there is a destination to forward to web traffic to, the connection would be forwarded. In perhaps most cases, connections to port 80 would be redirected by rules in the firewall to port 443. 

--
--
Chromium OS Discussion mailing list: chromium-...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-discuss
---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dis...@chromium.org.

Mike Frysinger

unread,
Sep 1, 2019, 1:48:27 PM9/1/19
to gar...@zscaler.com, Chromium OS Discussion
if a scheme isn't specified, Chrome defaults to http:// because that's what web browsers expect.  that's port 80 by default.

if you explicitly put in https:// then it will default to port 443.

as you noted, HSTS changes the default when unspecified from http:// to https://.  keep in mind that Chrome ships with a large preseeded HSTS list.  so even if you've never visited a site before (like google.com), Chrome will default to https:// because it's in the HSTS list.  see:

--
Reply all
Reply to author
Forward
0 new messages