当我去: http : //web-sniffer.net/并检查我的网站的标题( https://www.example.org ),我得到一个状态代码200
但是当我使用单选buttonHTTP / 1.0(没有主机头),我得到一个状态代码400(坏请求)。
我的apache日志说:“通过SNI提供的主机名www.example.org,但没有HTTP请求中提供的hostnmae”
我读了,使其工作我需要closures指令“SSLStrictSNIVHostCheck”在我的Apacheconfiguration文件。
我添加了这个指令,但是在制作HTTP / 1.0(没有主机头)的时候,我仍然得到了状态码400。
作为参考,这是我的ports.conf文件:
ServerName www.example.org NameVirtualHost *:80 Listen 10.0.0.1:80 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to <VirtualHost *:443> # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. Listen 443 NameVirtualHost *:443 SSLStrictSNIVHostCheck off </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
这是我的default-ssl文件:
<IfModule mod_ssl.c> <VirtualHost *:443> ServerName www.example.org ServerAdmin [email protected] SSLStrictSNIVHostCheck off Alias /static /home/ubuntu/public_html/static <Directory /home/ubuntu/public_html/static> Order deny,allow Allow from all </Directory> Alias /media /home/ubuntu/public_html/media <Directory /home/ubuntu/public_html/media > Order deny,allow Allow from all </Directory> WSGIScriptAlias / /home/ubuntu/public_html/apache.wsgi ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> # SSL Engine Switch: # Enable/Disable SSL for this virtual host. SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM SSLCertificateFile /etc/ssl/crt/example_org.crt SSLCertificateKeyFile /etc/ssl/crt/server.key SSLCertificateChainFile /etc/ssl/crt/ca.crt SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> </IfModule>
就我所看到的Apache源代码而言 ,你不能用任何 Apacheconfiguration选项来做到这一点。 你必须发送一个主机:头匹配通过SNI发送的Apache接受它。
RFC 6066第11.1节规定,networking服务器必须检查通过SNI发送的主机:头和主机名是否匹配。
实际上,任何在过去15年左右生产的讲HTTP的软件都应该在每个请求的时候发送Host:头。 如果你真的有一些不是这样的东西,那要么就是在互联网上太古老了,要么就是坏掉了。
听起来像这个testing(网站)是坏的。 如果您在没有主机头的情况下使用HTTP / 1.0,则不太可能发送了SNI扩展。 我不认为你需要“修复”你的网站来支持这一点。