Victor Rocheron
Victor Rocheron

Reputation: 69

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 :

enter image description here

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

Upvotes: 0

Views: 1744

Answers (2)

Sa&#239;d Aarabat
Sa&#239;d Aarabat

Reputation: 26

On visual studio, go to your project properties -> Web and uncheck the box that says "override application root URL".

Upvotes: 1

Daniel Soares
Daniel Soares

Reputation: 21

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

Upvotes: 0

Related Questions