Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core SSL - template shows in browser only PR_CONNECT_RESET_ERROR (Firefox)

I only created a .NET Core web application from the VS 2017 template dialog with "Configure for HTTPS" on.

I used

dotnet dev-certs https --trust

and confirmed the prompt. I checked with the MMC that the localhost certificate exists in CurrentUser/My.

When I now run the application Firefox only shows me (I don't know the exact english translation)

There was an error connecting to https//localhost:44371 PR_CONNECT_RESET_ERROR

Chrome also shows following error,

ERR_CONNECTION_RESET

I also disabled Windows Firewall but the result was the same.

When I unchek Enable SSL in the project debug properties the site displays nicely but without HTTPS.

Any one knows what could be wrong or where in Github I could find the code looking up for the the certificate?


Update 1:

I switched from starting the application from Visual Studio (2017) with IIS Express to Kestrel which brought up the console windows and told me something more:

info: Microsoft.AspNetCore.Server.Kestrel[20]
      Connection id "0HLOLGRVN8U0U" request processing ended abnormally.
System.IO.IOException: The decryption operation failed, see inner exception. ---
> System.ComponentModel.Win32Exception: Beim Verarbeiten des Zertifikats ist ein
 unbekannter Fehler aufgetreten
   --- End of inner exception stack trace ---
   at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TRea
dAdapter adapter, Memory`1 buffer)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal.AdaptedPipeline.
ReadInputAsync(Stream stream)
   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
   at System.IO.Pipelines.Pipe.GetReadAsyncResult()
   at System.IO.Pipelines.Pipe.DefaultPipeReader.GetResult(Int16 token)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Proces
sRequests[TContext](IHttpApplication`1 application)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Proces
sRequestsAsync[TContext](IHttpApplication`1 application)

System.ComponentModel.Win32Exception: Beim Verarbeiten des Zertifikats ist ein unbekannter Fehler aufgetreten

is translated

System.ComponentModel.Win32Exception: An unknown error occured while processing the certificate

Under Kestrel Firefox at least brings up the page where I can trust the self signed certificate and the page gets displayed. (but now on different ports 5001 for https and 5000 for http). Chrome does not ask to trust the certificate and just keeps working as expected.

Seems to be a problem with the certificate and/or IIS Express for me.


Found that one though this is kind of a different problem.

like image 751
monty Avatar asked Jul 31 '19 06:07

monty


1 Answers

Two more cases.

First. I have tried all troubleshooting recommendations by Microsoft and nothing helped. Then i repaired IIS Express program, it fixed this problem. enter image description here

Second. If you have Kaspersky antivirus it may not trust self-signed sertificates and block https connections to localhost. You have to make localhost domain to be ignored in the settings at «Settings > Advanced > Network» tab.

like image 75
Sam Alekseev Avatar answered Sep 20 '22 03:09

Sam Alekseev