I have a REST api with .net CORE 3.1, when I run it as a project it works fine. I posted it a few days ago and it worked fine on an IIS server. Then I made some changes to it and it doesn't work anymore, when I updated the api I just added a new class to it to map an object, I didn't interfere with the web.config or any other configuration.
here the web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\API.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
Here I attach my launchSettings.json:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://dominio.com.mx",
"sslPort": 44349
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/Conductores",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
},
"REST_API": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/Conductores",
"applicationUrl": "http://dominio.com.mx/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
},
"TESTING": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/Conductores",
"applicationUrl": "http://localhost:80/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
When I publish it to my local IIS server it works but, through postman, it gives me this warning:
This is the message: Warning: Unable to verify the first certificate
When I publish it to a remote IIS server, it sends me the following message:
Hostname/IP does not match certificate's altnames.
What could this error be due to?
I already tried to enable TLS and it didn't work:
Which was to add the TLS keys.
I was able to solve the problem, but it wasn't an error with the security certificate, I don't know why it gave me that error. The detail was that my route was misspelled.
I was like this
when it should be like this
That's why when entering the site https//:domain/api/Datos I couldn't find it since it was detected in this way https//:domain/api/api/Data . The error was actually a 404 but I don't know because I associate it with a certificate error.