我有一个托管在IIS8.5上的asp.net网站,我使用以下规则将所有流量重定向到HTTPS:
<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{SERVER_PORT_SECURE}" pattern="^0$" />
</conditions>
<action type="Redirect" url="https://example.com{REQUEST_URI}" redirectType="Temporary" />
</rule>当用户使用https://192.168.0.3访问站点时,这不起作用
Your connection is not private
Attackers might be trying to steal your information from 192.168.0.3 (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_COMMON_NAME_INVALID安装的SSL是为域example.com安装的,似乎请求没有到达IIS,因此我无法对其进行任何控制...?我不能控制用户强制他们使用域名地址。
如何将https:/192.168.0.3重定向到https://example.com
发布于 2019-03-04 12:30:23
尝试SSL保护本地IP url将始终以证书错误AFAIK结束
请阅读本文以了解更多信息:https://security.stackexchange.com/questions/103524/lets-encrypt-for-intranet-websites
编辑:我对IIS了解不多,但在这个问题上找到了这个,也许它会帮助你解决这个问题:https://blogs.msdn.microsoft.com/robert_mcmurray/2013/11/15/how-to-trust-the-iis-express-self-signed-certificate/
发布于 2019-03-11 12:09:33
考虑到HTTPS私有IP永远不会工作(您无法获得有效的证书),我假设您已经得到了这里,因为您已经获得了从http://192.168.0.3到https://192.168.0.3的全局重定向。只需修复重定向,使其从http://192.168.0.3直接转到https://example.com即可。
发布于 2019-03-08 20:41:41
您可以在IIS中创建另一个网站,并将IP地址绑定到该网站。然后在该网站中创建一个重定向到正确的域的Default.aspx页面。
<%@ Page Language="C#" %>
<%
Response.Redirect("https://example.com");
%>或者只是一个经过url重写的web.config文件
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url="(.*)" />
<action type="Redirect" redirectType="Permanent" url="https://example.com" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>https://stackoverflow.com/questions/54919405
复制相似问题