Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect HTTPS IP to domain

I have an asp.net website hosted on IIS 8.5 and I am using the following rule to redirect all traffic to 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>

This does not work when a user accesses the site using 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

The SSL installed is for the domain example.com and it seems the request does not reach IIS so I dont have any control over it....? I dont have control over the user to force them to use the domain url.

How do I redirect https:/192.168.0.3 to https://example.com?

like image 688
Vaibhav Garg Avatar asked Nov 15 '25 20:11

Vaibhav Garg


1 Answers

Trying to SSL secure a local IP url will always end up with a Certificate Error AFAIK

Read this to learn more about it: https://security.stackexchange.com/questions/103524/lets-encrypt-for-intranet-websites

Edit: I don’t know a lot about IIS but found this on this matter, probably it’ll help you solve this: https://blogs.msdn.microsoft.com/robert_mcmurray/2013/11/15/how-to-trust-the-iis-express-self-signed-certificate/

like image 77
x3l51 Avatar answered Nov 17 '25 11:11

x3l51



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!