Creating .NET Core Certificates

From Logic Wiki
Revision as of 09:29, 5 October 2021 by AliIybar (Talk | contribs) (Created page with "Category:Envoy Category:Dotnet Category:Microservices Category:Security Category:SSL == Generating a certificate == Generating a certificate and export it...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Generating a certificate

Generating a certificate and export it to USERPROFILE path (-ep : export path) SignAPI.pfx should case sensitive and must match the dll name

dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\SignAPI.pfx -p pa55w0rd!

you should see this

A valid HTTPS certificate is already present.
dotnet dev-certs https --trust

if it's already there this must be seen

Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate.
A valid HTTPS certificate is already present.

User Secrets

in .csproj file after <TargetFramework> tag add this with a newly generated GUID

 <UserSecretId>Sign-API-[GUID]</UserSecretId>

Setting Secret

in the project folder where .csproj file is :

dotnet user-secrets set "Kestrel:Certificates:Development:Password" "pa55w0rd!"

it should say

Successfully saved Kestrel:Certificates:Development:Password = pa55w0rd! to the secret store.

and the secret is saved in C:\Users\<ProfileFolder>\AppData\Roaming\Microsoft\UserSecrets\Sign-API-[GUID]