使用TLS/SSL (HTTPS)加密时,所有url都加密了吗?我想知道,因为我想在使用TLS/SSL (HTTPS)时隐藏所有URL数据。

如果TLS/SSL提供了URL的全部加密,那么我就不必担心从URL中隐藏机密信息。


当前回答

正如其他答案已经指出的,https“url”确实是加密的。然而,解析域名时您的DNS请求/响应可能不是,当然,如果您使用浏览器,您的url也可能被记录。

其他回答

是的,SSL连接是在TCP层和HTTP层之间。客户端和服务器端首先建立一个安全的加密TCP连接(通过SSL/TLS协议),然后客户端通过加密的TCP连接发送HTTP请求(GET, POST, DELETE…)

但是请注意(在评论中也提到了),URL的域名部分在TLS协商的第一部分以明文形式发送。因此,可以嗅出服务器的域名。但不是URL的其余部分。

It is now 2019 and the TLS v1.3 has been released. According to Cloudflare, the server name indication (SNI aka the hostname) can be encrypted thanks to TLS v1.3. So, I told myself great! Let's see how it looks within the TCP packets of cloudflare.com So, I caught a "client hello" handshake packet from a response of the cloudflare server using Google Chrome as browser & wireshark as packet sniffer. I still can read the hostname in plain text within the Client hello packet as you can see below. It is not encrypted.

因此,请注意您可以阅读到的内容,因为这仍然不是一个匿名连接。客户机和服务器之间的中间件应用程序可以记录客户机请求的每个域。

所以,看起来SNI的加密需要额外的实现才能与TLSv1.3一起工作

2020年6月更新: 它看起来像加密SNI是由浏览器发起的。Cloudflare有一个页面供您检查您的浏览器是否支持加密SNI:

https://www.cloudflare.com/ssl/encrypted-sni/

在这一点上,我认为谷歌chrome不支持它。您可以在Firefox中手动激活加密SNI。当我因为某种原因尝试它时,它并没有立即起作用。我重启了两次Firefox,它才开始工作:

URL字段类型:about:config。

检查network.security.esni.enabled是否为true。 清除缓存/重新启动

去我之前提到的那个网站。

正如你所看到的,对于那些想要确保咖啡店老板不会记录人们访问的网站列表的人来说,VPN服务今天仍然很有用。

此外,如果您正在构建一个ReSTful API,浏览器泄漏和http引用程序问题将在很大程度上得到缓解,因为客户端可能不是浏览器,您可能没有人点击链接。

如果是这种情况,我建议登录oAuth2以获得一个不记名令牌。在这种情况下,唯一的敏感数据将是初始凭证……无论如何,这应该在post请求中

You can not always count on privacy of the full URL either. For instance, as is sometimes the case on enterprise networks, supplied devices like your company PC are configured with an extra "trusted" root certificate so that your browser can quietly trust a proxy (man-in-the-middle) inspection of https traffic. This means that the full URL is exposed for inspection. This is usually saved to a log. Furthermore, your passwords are also exposed and probably logged and this is another reason to use one time passwords or to change your passwords frequently. Finally, the request and response content is also exposed if not otherwise encrypted. One example of the inspection setup is described by Checkpoint here. An old style "internet café" using supplied PC's may also be set up this way.

整个请求和响应都是加密的,包括URL。

请注意,当你使用HTTP代理时,它知道目标服务器的地址(域),但不知道该服务器上的请求路径(即请求和响应始终是加密的)。