N
N
Neckvik2019-05-09 23:45:03
Browsers
Neckvik, 2019-05-09 23:45:03

How is it determined by which protocol the interaction will be http or https?

I can't find any information please help me.
I know that if a site or service supports https, then the port for http should be redirected to https.

I can not understand how it is determined by which protocol the browser is connected? How does the browser determine if there is https or does it just knock on http and then the server redirects itself to https, so what?

And how does it look in any application, in the same way in the browser or in some other way? in many languages, to make a post request, for example, you must explicitly specify http or https. and what happens if we specify https, and the server only supports http

And it doesn’t affect us in any way whether we specify https:// in the URL or not?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
R
Rsa97, 2019-05-09
@Rsa97

If you do not explicitly specify the protocol in the address bar of the browser, then http will be used by default. The server can then return a redirect, explicitly indicating that it needs to work with https.

F
Fixid, 2019-05-10
@Fixid

By default, the browser thinks that http is port 80 and https is port 443.
When you specify http in the address, the browser climbs the http port to port 80.
When you specify https in the address, the browser climbs the https port to port 80.
If you do not specify the protocol, then the browser first tries http and if it fails https
But the web server can force a redirect (301) from one protocol to another If the server does not support https, and you specified it, then depending on the server settings, you will get an instant hit on port 443 or you will get a timeout error

S
Saboteur, 2019-05-10
@saboteur_kiev

And it doesn’t affect us in any way whether we specify https:// in the URL or not?

of course it does. What they indicated will go to that port.
http - 80
htps - 443
ftp - 21
if not specified, http is considered by default

R
rogiivs, 2019-05-09
@rogiivs

the condition is written in a file called .htaccess in most cases. Here you can read more Redirect from http to https

C
chupasaurus, 2019-05-10
@chupasaurus

When connecting via HTTP, the client immediately sends a request, the server starts waiting immediately after the connection is established.
When connecting over HTTPS, the client must first initiate connection encryption. If the client immediately sends a request, then the server, according to the specification, must respond with a 400 Bad Request code (Incorrect request), they also usually send a comment about actually sending the request without encryption in the response body with an error.

N
Neckvik, 2019-05-10
@Neckvik

Another question arose why there are two different sites in http and https search engines?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question