【问题标题】:Apache proxy says hostname from SNI doesn't match hostname from HTTPApache 代理说来自 SNI 的主机名与来自 HTTP 的主机名不匹配
【发布时间】:2021-05-06 04:51:03
【问题描述】:

我正在 Apache 2.4 上设置转发代理,我发现对 HTTPS url 的每个请求都会导致 400 响应。

apache错误日志显示:

[ssl:error] AH02032:通过 SNI 提供的主机名 my.example.net 和通过 HTTP 提供的主机名 stanford.edu 不同

我可能做错了什么?我的配置如下:

Listen 3443

<VirtualHost *:3443>
  SSLEngine on
  ProxyRequests on
  ProxyVia off

  <Proxy *>
    Allow from all
  </Proxy>

  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/my.example.net/cert.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/my.example.net/privkey.pem
  SSLCertificateChainFile /etc/letsencrypt/live/my.example.net/chain.pem

  ErrorLog /var/log/httpd/myerr.log
</VirtualHost>

我已尝试添加以下所有内容,但没有效果:

  • SSLProxyEngineonoff
  • SSLProxyVerify none
  • AllowCONNECT 443

我通过运行测试代理:

https_proxy='https://my.example.net:3443/' curl 'https://stanford.edu/'

我的服务器 my.example.net 在 CentOS 7 上运行 Apache 2.4

【问题讨论】:

    标签: apache ssl https proxy


    【解决方案1】:

    curl 命令似乎是问题所在:不要对 https_proxy 变量使用 https 方案,而是使用 http(这样只有一个 TLS 连接,它直接通过目标主机):

    https_proxy='http://my.example.net:3443/' curl 'https://stanford.edu/'
    

    【讨论】:

      猜你喜欢
      • 2020-07-29
      • 2013-01-24
      • 2015-03-02
      • 1970-01-01
      • 1970-01-01
      • 2011-08-20
      • 1970-01-01
      • 2019-04-30
      • 2020-05-19
      相关资源
      最近更新 更多