3

Using:
MacOS 11.5.1
Rider 2021.1.4
.NET SDK 5.0.300 commit 2e0c8c940e
Microsoft.AspNetCore.App 5.0.6
Microsoft.NETCore.App 5.0.6

Running an unmodified Weather Forecast template

Certificate is not being found. Despite Rider telling me that it was set up successfully.

Deleted all localhost certificates from Keychain before running this

% dotnet dev-certs https --clean
Cleaning HTTPS development certificates from the machine. This operation might require elevated privileges. If that is the case, a prompt for credentials will be displayed.
HTTPS development certificates successfully removed from the machine.
% dotnet dev-certs https --check
No valid certificate found.
% dotnet dev-certs https        
The HTTPS developer certificate was generated successfully.
% dotnet dev-certs https --trust
Trusting the HTTPS development certificate was requested. If the certificate is not already trusted we will run the following command:
'sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain <<certificate>>'
This command might prompt you for your password to install the certificate on the system keychain.
The HTTPS developer certificate was generated successfully.
% dotnet dev-certs https --check
No valid certificate found.

After that I have a validated System and Login localhost certificates in the Keychain, but the application is still crashing with an Exception

System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.
      To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.
      For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
         at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action`1 configureOptions)
         at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IEnumerable`1 listenOptions, AddressBindContext context)
         at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
         at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
Unhandled exception. System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.
ronimizy
  • 66
  • 5
  • try restarting your computer. – Pritom Sarkar Aug 07 '21 at 08:44
  • @PritomSarkar I have tried this, even updated the OS in the meantime – ronimizy Aug 07 '21 at 12:16
  • ```dotnet tool uninstall --global dotnet-dev-certs``` and ```dotnet tool install --global dotnet-dev-certs``` try that. – Pritom Sarkar Aug 07 '21 at 12:47
  • @PritomSarkar I reinstalled whole dotnet yesterday and problem still was present after that. To be sure I did reinstalled dev-certs right now and nothing has changed – ronimizy Aug 07 '21 at 13:38
  • https://stackoverflow.com/questions/53300480/unable-to-configure-https-endpoint-no-server-certificate-was-specified-and-the and https://stackoverflow.com/questions/54371101/cannot-create-developer-certificate-on-mac/56709117#56709117 read this.it's help resolve your issue. – Pritom Sarkar Aug 07 '21 at 16:02
  • @PritomSarkar already tried these answers – ronimizy Aug 07 '21 at 16:38

1 Answers1

0

The solution that helped me eventually was to unlock a system keychain in a Keychain Access app before running a dotnet dev-certs https --trust

ronimizy
  • 66
  • 5