springspring-bootgoogle-chromehttps

Access localhost via HTTPS by Chrome on Ubuntu ("NET::ERR_CERT_AUTHORITY_INVALID")


I want to access localhost via HTTPS by Chrome.

Would you tell me how to solve ?

my environment:

Ubuntu 18.04
Chrome 79
Spring Boot 2.2.2
Tomcat 9

*1 create self-signed certification:

$ keytool -genkeypair -alias tomcat -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650 -ext san=dns:localhost -ext san=ip:127.0.0.1

*2 enable HTTPS on Spring Boot

$ vi src/main/resources/application.properties
  server.port=8443↲
  server.ssl.enabled=true↲
  server.ssl.key-store=keystore.p12↲
  server.ssl.key-store-password=password↲
  server.ssl.key-password=password↲
  server.ssl.key-store-type=PKCS12↲
  server.ssl.key-alias=tomcat↲
  security.require-ssl=true↲

*3 import the certificattion

$ keytool -exportcert -keystore keystore.p12 -alias tomcat -file keystore.der

(or when I access localhost, export the certificate from Chrome display)

After do, on Manage certificates import keystore.der.(Chrome setting:GUI)

Thanks Regard.


Solution

  • Solved

    Getting Chrome to accept a self-signed localhost certificate

    Excerpt from the above link

    1. on Terminal
    1. on Chrome
    1. on Terminal