BorisWilhelms / create-dotnet-devcert

A simple script that creates and trusts a self-signed development certificate for dotnet on Linux distributions.
https://blog.wille-zone.de/post/aspnetcore-devcert-for-ubuntu
MIT License
329 stars 71 forks source link

Work well before but error when upgrading to 22.04 from 20.04 #14

Open duyet-lfg opened 1 year ago

duyet-lfg commented 1 year ago

It work very well before but now after upgrading to 22.04 I got issue like below when running app

However, the chrome still detect https OK for the service. Just error when calling this https service (authen) from another service (Microservices)

I rerun your script, delete https file, even reinstall dotnet. But still doesn't work

: requestId: 0HMT1N9A3RC2T:00000005, previousRequestId: no previous request id, message: Error Code: ConnectionToDownstreamServiceError Message: Error connecting to downstream service, exception: System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception) at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions) at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm) at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken) --- End of inner exception stack trace ---

PS /home/xxx> sudo dotnet dev-certs https --check --verbose

Welcome to .NET 7.0!

SDK Version: 7.0.400 [1] Listing certificates from CurrentUser\My [2] Found certificates: 1 certificate 1) 530F28819E601A593EE90993E697E7540C150AC9 - CN=localhost - Valid from 2023-05-30 12:06:30Z to 2024-05-29 12:06:30Z - IsHttpsDevelopmentCertificate: true - IsExportable: true [3] Checking certificates validity [4] Valid certificates: 1 certificate 1) 530F28819E601A593EE90993E697E7540C150AC9 - CN=localhost - Valid from 2023-05-30 12:06:30Z to 2024-05-29 12:06:30Z - IsHttpsDevelopmentCertificate: true - IsExportable: true [5] Invalid certificates: no certificates [6] Finished listing certificates. A valid certificate was found: 530F28819E601A593EE90993E697E7540C150AC9 - CN=localhost - Valid from 2023-05-30 12:06:30Z to 2024-05-29 12:06:30Z - IsHttpsDevelopmentCertificate: true - IsExportable: true

image