Use of LetsEncrypt certificate in Blazor Webassembly project published on ISS in Windows Server

Hi all,
I’m following this solution to use certificate for my Webassembly project. InvalidOperationException: Key type not specified. Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()

If I use a Let’s Encrypt certificate I’ll not have a password.
How can I add LetsEncrypt certificate into appsettings.json?
This is a sample of my part of code to edit with the certificate information, password is required.

     "IdentityServer": {
    "Key": {
      "Type": "File",
      "FilePath": "C:\cert.pfx",
      "Password": "password123"
    }
  }

How can I edit it?

Hi @MarioC

if you use a Letsencrypt certificate and if you create a pfx file, you have a password.

Where I can find the password?

I guess you’ll get asked for one when you create a .pfx file.

By chose the option “N: Create new certificate” there is no way to set password, maybe with advanced options (M).

So… what happens if you leave the password empty in your config file?

You should read the documentation for your acme client.

If you really need to add a password, openssl can do it.

If I leave the password empty:
info: IdentityServer4.Startup[0]

  Starting IdentityServer4 version 3.0.0.0

crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]

  Application startup exception

System.InvalidOperationException: There was an error loading the certificate. Either the password is incorrect or the process does not have permisions to store the key in the Keyset ‘DefaultKeySet’

I solved by creating a new certificate with advanced options, in this way I can set the password required to use certificate in my .NET Core project.
Thanks for wrote me that also Let’s Encrypt certificate can have a password.
Greetings at all.

1 Like

That's not a feature of a certificate.

That's a feature of the file type you use to store the certificate. If your Letsencrypt client supports such additional options, you can use these.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.