c# - 使用 IP 而不是 localhost ASP.Net 和 SSL

标签 c# asp.net ssl

我正在尝试在我的 ASP.Net 项目上启用 SSL,并且它实际上可以在 localhost 上正常工作,但是当我尝试用我的 IP 替换 localhost 时,出现以下错误:

enter image description here

经过一些研究,我已经像这样编辑了 applicatihost.config 绑定(bind):

          <sites>
            <site name="SansSoussi" id="1">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="C:\Projects\SansSoussi\SansSoussi" />
                </application>
                <bindings>
                    <binding protocol="https" bindingInformation="*:44372:localhost" />
                    <binding protocol="https" bindingInformation="*:44372:*" />
                </bindings>
            </site>
           
        <siteDefaults>
            <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
            <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
        </siteDefaults>
        <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
        <virtualDirectoryDefaults allowSubDirConfig="true" />
    </sites>

仍然有同样的错误..

感谢您的帮助:)

最佳答案

在 visual studio 上,转到您的项目属性 -> Web 并取消选中“覆盖应用程序根 URL”框。

关于c# - 使用 IP 而不是 localhost ASP.Net 和 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46576120/

相关文章:

c# - 新鲜的 ASP.NET Core API 返回空的 JSON 对象

java - 在旧的 Android 设备上找不到证书路径的信任 anchor

android - 在 Android 中使用 websocat 连接到 WSS

c# - 如何比较HH :MM in C#

asp.net - 是否可以使用Membership API更改用户名

c# - 如何在 AutoMapper 中映射这种父子关系?

asp.net - 运行 ASP.NET 应用程序的服务器的 DNS

php - SSL 加密问题

c# - 有一种方法可以按位置从服务器端向设备发送推送吗?

c# - 尝试与 TcpClient 连接时出现 SocketException