Hi Alex,
If you're working with Kestrel you can modify the launchSettings.json
file and in the applicationUrl add another URL for the secure connection. For example, I changed it from
{
"profiles": {
"ServerAPIs": {
"launchBrowser": true,
"applicationUrl": "http://0.0.0.0:5000",
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"launchUrl": "swagger",
"ischecked": "true"
}
}
}
to
{
"profiles": {
"ServerAPIs": {
"launchBrowser": true,
"applicationUrl": "http://0.0.0.0:5000/;https://0.0.0.0:5001",
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"launchUrl": "swagger",
"ischecked": "true"
}
}
}
and that serves the Swagger application on HTTPS on port 5001
If you're using SnapDevelop you can open the ServerAPIs project's properties to change this setting:
If you're using something other than Kestrel, you have to check the respective documentation for the Web Server you're using to serve the WebAPIs
Regards,
Francisco
In this case PS 2021 is working on IIS with HTTPS. The Web API works fine but swagger doesn't.
Alex.