我的浏览器如何将我的 http 请求转换为 https?
朋友们,我想知道当安全托管完成后,我们需要一个唯一的 IP 地址来将我们的 SSL 证书关联到它。另外,我在一篇教程中读到,当浏览器请求安全连接时,所有 SSL 进程都会启动。但是浏览器如何请求安全连接。我们不就写www.chase.com吗?然后我们的浏览器将http转换为https?后台发生了什么?
Friends I want to know for when a secured hosting is done, we require an unique ip address to associate our SSL Certificate to it. Also, I kinda read in one tutorial that when a browser requests for a secured conncetion then all the SSL process initiates. But how does a browser request for a secure connection. Don't we just write www.chase.com? And then our browser converts the http to https? Whats happening in the background?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一步一步(假设 HSTS 标头未处于活动状态,它将自动使用 https,而无需创建https >http 请求):
www.example .com 以移动后的状态代码进行响应并给出新位置:
HTTP/1.1 301 永久移动
位置:https://www.example.com/
浏览器读取该内容并知道它必须启动安全 HTTPS 连接。
无论如何,如果您需要安装 SSL / TLS 证书,则必须确保您的客户端从 HTTP 重定向到 HTTPS。这应该通过服务器配置来完成。
Step by step (Assuming HSTS header is not active in which it will automatically use https without making a http request):
www.example.com responds with a moved status code and gives the new location:
HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/
The browser reads that and knows that it must start a Secure HTTPS connection.
Anyway, if what you need is to install an SSL / TLS certificate you must make sure that your client is redirected from HTTP to HTTPS. That should be accomplished from the server configurations.
在您的编程代码中,您可以使用 301(服务器端)评估协议并进行重定向。 这不是在浏览器中完成的。
您可以在 ASP.NET 中的
Global.asax
文件中执行此操作我不确定其他编程语言(PHP、Ruby 等)。其他人可以随意插话并用更多示例编辑我的答案。
我认为默认情况下您可以使用 .htaccess 在 Apache 中执行此操作,但据我所知,如果您想这样做在 IIS 中,您需要运行一个 asp 脚本或将其包含在您的 .net 应用程序中。我可能是错的,但这就是我在尝试中遇到的问题。
In your programming code, you evaluate the protocol and redirect using a 301 (server side). This is not done in the browser.
You can do this in ASP.NET in the
Global.asax
fileI'm not sure about other programming languages (PHP, Ruby, etc). Others can feel free to chime in and edit my answer with more examples if they please.
I think you can do this by default in Apache using .htaccess, but as far as I can tell, if you want to do it in IIS you need to run an asp script or include it in your .net application. I could be wrong, but this is what I've come up against in my trials of this.