AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 882026
Accepted
Lenne
Lenne
Asked: 2017-11-07 03:09:29 +0800 CST2017-11-07 03:09:29 +0800 CST 2017-11-07 03:09:29 +0800 CST

hsts 在主端口 80 上,不在其他端口上

  • 772

我在网站http://server.mydom.tld:80上为我的域设置了 hsts,因此浏览器转到端口 443 上的端口https://server.mydom.tld

但是,我还有其他网络服务器,在其他端口上运行。因此,当我转到http://server.mydom.tld:8888时,它会被转发到https://server.mydom.tld:8888,但该服务器未运行 https,因此请求失败。

是按照规范吗?

我注意到我没有在http://mydom.tld或http://www.mydom.tld上运行 hsts ,这可能是一个错误。

该怎么办?

hsts
  • 3 3 个回答
  • 4201 Views

3 个回答

  • Voted
  1. Best Answer
    argure
    2017-11-08T10:49:53+08:002017-11-08T10:49:53+08:00

    是的,这是故意的。RFC 6797规定:

         The UA MUST replace the URI scheme with "https" [RFC2818], and
    
         if the URI contains an explicit port component of "80", then
         the UA MUST convert the port component to be "443", or>>
    
         if the URI contains an explicit port component that is not
         equal to "80", the port component value MUST be preserved;
         otherwise,
    
         if the URI does not contain an explicit port component, the UA
         MUST NOT add one.
    
         NOTE:  These steps ensure that the HSTS Policy applies to HTTP
                over any TCP port of an HSTS Host.
    

    您应该在不同的域上运行纯 HTTP 服务,或者更好的是,使用 HTTP+TLS 服务器作为内部纯 HTTP 服务的反向代理。

    • 17
  2. Somebody
    2019-01-30T04:09:01+08:002019-01-30T04:09:01+08:00

    当使用 HTTP 访问您的站点时,浏览器会忽略 Strict-Transport-Security 标头;这是因为攻击者可能会拦截 HTTP 连接并注入或删除标头。当您的站点通过 HTTPS 访问且没有证书错误时,浏览器就知道您的站点支持 HTTPS,并将遵守 Strict-Transport-Security 标头。

    • 1
  3. Lenne
    2019-12-13T23:57:58+08:002019-12-13T23:57:58+08:00

    如果真的不想在另一个服务上运行 https,可以在 DNS 中添加一个别名,这样https://server.domain.tld和http://service.domain.tld:8888就在同一个 IP 上/服务器

    然后可以添加从http://service.domain.tld和https://service.domain.tld到http://service.domain.tld:8888的重定向

    • 0

相关问题

  • 来自 S3 源的 Amazon CloudFront 上的 HSTS

  • CloudFront 上的 SSL 未通过测试

  • 禁用 HSTS 和 HPKP

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve