I'm working on two web applications:
- App1 is an application written in ASP.NET and runs directly on Windows 10. This application can be reached via browser at https://localhost:44311/
- App2 is written in Django and runs in Ubuntu-20.04 through WSL2 on the same Windows computer. This application can be reached via browser at the address http://localhost:8000/
I am trying to make an https call from the App2's backend to the App1's backend. Disabling the Windows 10 firewall and reading another question it seems to me that the part correctly but App1 returns an error. I tried to execute the following instruction on the Ubuntu WSL shell:
curl -k https://DESKTOP-2MCFHIT.local:44311
But I get the following error:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Hostname</h2>
<hr><p>HTTP Error 400. The request hostname is invalid.</p>
</BODY></HTML>
It appears that IIS Express is unable to handle the request correctly due to not using "localhost". How can I solve?