tnc1997 / samples

MIT License
54 stars 41 forks source link

Trusting a self-signed certificate on Linux #45

Closed tuana2k38 closed 1 year ago

tuana2k38 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Current behavior Steps to reproduce the behavior:

  1. Step 1: Generate a self-signed certificate was successful
  2. Step 2: Import the self-signed certificate. was not work!

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here.

tnc1997 commented 1 year ago

Hi @tuana2k38, it looks like you are using Linux but that command is intended for use on Windows.

Please see this answer on Stack Exchange for details on trusting a self-signed certificate on Linux.

openssl req -x509 -newkey rsa:4096 -keyout localhost.key -out localhost.crt -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,DNS:api,DNS:identityserver"
sudo cp localhost.crt /usr/local/share/ca-certificates
sudo update-ca-certificates
tuana2k38 commented 1 year ago

What about this cmd: openssl pkcs12 -export -in localhost.crt -inkey localhost.key -out localhost.pfx -name "Adding JWT Bearer Authentication to a Hot Chocolate 12 GraphQL API".

tnc1997 commented 1 year ago

What about this cmd

Apologies for missing that, you will need that for the application.

tuana2k38 commented 1 year ago

thanks for your support!