Reputation: 51
If client/browser trying to access http via 80, most likely it will be redirected to https/443 due to server configuration.
Will browser actually automatically establish new connection to port 443 or reuse the previous connection?
How exactly http redirection work at layer 4?
Upvotes: 0
Views: 302
Reputation: 123340
A new TCP connection will be established already because the target port for HTTPS is different from HTTP and thus the old TCP cannot be used further. Even if the target port would be the same (which could in theory be done, although not with most web server implementations) then the standard does not define a way to upgrade a plain HTTP connection to HTTPS while keeping the underlying TCP connection.
Note the this is different from a TLS upgrade in protocols like SMTP or IMAP, where after STARTTLS the same TCP connection will still be used. Data exchange continues in this case after a successful TLS handshake on the existing connection.
Upvotes: 2