Unable to verify the first certificate with postman on new .Net 5 core project

Viewed 4876

i need an help. So i've created a project .NET core 5 with HTTPS. The project is new new.

So added the TestController where on get request i will have:

    // GET: api/<TestController>
    [HttpGet]
    public IEnumerable<string> Get()
    {
        return new string[] { "value1", "value2" };
    }

So, if i call the api https://localhost:44310/api/test on the browser:

["value1","value2"] //that works correctly

But if i call the url on postman i receive:

  <!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>

My postman option: enter image description here

and

enter image description here

and

enter image description here

and

enter image description here

where i'm wrong? I need to settings visual studio with other options? Maybe i need to use localhost certificate? Why i get this error only in postman and not by browser??

0 Answers
Related