简体   繁体   中英

Use IP instead of localhost ASP.Net with SSL

I'm trying to enable SSL on my ASP.Net project, and, it actually work fine with localhost, but when I try to replace localhost with my IP, I got the following error :

在此处输入图片说明

After some research, I've edited the applicatihost.config bindings like this :

          <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>

Still got the same error..

Thanks for your help :)

在Visual Studio上,转到项目属性-> Web,然后取消选中“覆盖应用程序根URL”框。

Thats because u need to include your machine name in etc\\hosts as you dont have a DNS to resolve that name.

C:\Windows\System32\drivers\etc\hosts

Include your "name" point to 127.0.0.1 like:

127.0.0.1 redacted

Another important point to pay attention is that if u are testing ssl certificates, certify that the name u put in certificate is exactly the name you route in etc\\hosts

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM