How to simulate SSL on ASP.NET localhost?

Asked

Viewed 776 times

1

How to simulate an SSL certificate on localhost, use Visual Studio 2017, running ASP.NET MVC5. I need this because I am running the API da Cielo which only accepts requests via SSL.

Edit: If I change the property SSL Enabled for true when I run the project and open the URL https://localhost:54346/ i get the following page:

inserir a descrição da imagem aqui

  • 3

    I just wanted to know why you were negative... but okay, let’s expect an answer or a critique about the question.

1 answer

1


  1. Open the Solution Explorer and select the web project
  2. Press the button F4.
  3. Change the property SSL Enabled for true. A URL will be created in the property SSL URL that will be the URL for use.

Obs.: When starting Debug, the url accessed will still be shown in the property URL. Ignore this and go to URL with HTTPS.

If you want to leave access HTTPS By default when starting Debug, do the following:

  1. In the Solution Explorer, right click on the web project and click on Properties;
  2. Click on the tab Web;
  3. Change the property Project Url to the address HTTPS seen in the first explanation;
  4. Click on Create Virtual Directory.

Ready! I hope I’ve helped!

  • Roberto, I did this but I’m not able to run the project, is there any other configuration to be done? give a look at the post Edit

  • Leonardo, don’t just put https:// in the url. You have to put the URL with another port, as you can see in the property SSL URL.

  • Roberto , continues the same error page.

  • I made an example that can be downloaded at the link https://ufile.io/lzz9r When starting the debug, it can be accessed by the URL http://localhost:4306/ and https://localhost:44310/ See if it works.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.