question

WebSpider-5357 avatar image
0 Votes"
WebSpider-5357 asked HuryShenMSFT-3800 edited

This site can’t provide a secure connection

Hi guys... i getting this error message when i open my web application after i installed visual studio 2019.

This site can’t provide a secure connection

I have tried changing my web.config to the following but failed.

 <rewrite>
   <rules>   
     <rule name="HTTP to HTTPS Redirect" stopProcessing="true">
       <match url="(.*)" />
       <conditions>
          <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
       </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
     </rule>
  </rules>
 </rewrite>
windows-server-iis
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

That message can occur in several cases (self signed certificate, mismatched Host header and so on). So you should diagnose directly by reading the browser detailed error message first, instead of blind guess on what might be wrong.

0 Votes 0 ·

Hi @lextm

The following is the browser detailed error message:

This site can’t provide a secure connection
localhost sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR

I tried clicking the Windows Network DIagnostics but not working as expected. What should i do next to find out what's the problem?

0 Votes 0 ·
cq65y.png (10.7 KiB)

Hi @lextm

I have make changes to C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer\applicationhost.config

119624-cq65y.png


Meanwhile, i have enabled SSL in Properties.
119615-01.png

My web application now is able to run but i have to manually change the port number from 50997 to 44366.

Any idea to change the port number? TQ~


0 Votes 0 ·
cq65y.png (10.7 KiB)
01.png (6.6 KiB)
HuryShenMSFT-3800 avatar image
0 Votes"
HuryShenMSFT-3800 answered HuryShenMSFT-3800 edited

Hi @WebSpider-5357 ,

You can right click your application in visual studio and click "Properties".

Then click "Web" tab and you can find "Project Url" input box. Change the url in this input box from original http://localhost:50997 to https://localhost:44366.

119595-image.png

After that, you do not need to change port number manually when you start the application in visual studio. It will browse with https://localhost:44366 automatically.


If the answer is helpful, please click "Accept Answer" and upvote it.


Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





image.png (38.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

WebSpider-5357 avatar image
0 Votes"
WebSpider-5357 answered HuryShenMSFT-3800 edited

hi @HuryShenMSFT-3800

Not sure why its show different screen when i right click and Properties

120731-01.png



01.png (51.1 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @WebSpider-5357 , please do not right click the "solution", you should right click the "project". Like this screenshot, you should right click the green box but not the red box.


0 Votes 0 ·
image.png (10.1 KiB)