I have an API written in ASP.NET and when I run it with IIS express, it opens up to the following page https://localhost:44381/api/strs
. This works completely fine. However, when I try to access it from another computer or even my local computer using my LAN address, https://10.0.0.185:44381/api/strs
, I get the error message HTTP Error 400. The request hostname is invalid.
EDIT - I realized I forgot to add that accessing from http://10.0.0.185:19093/
also gives the same error
These are my bindings
<bindings>
<binding protocol="https" bindingInformation="*:44381:10.0.0.185" />
</bindings>
and here is my launchsettings.json
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:19093",
"sslPort": 44381
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/strs",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"TestApi2": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/strs",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}
I have been trying to solve this problem for hours but no matter what I do I just get status code 400 or "network connection reset". Any help is appreciated.