Your connection is not private NET::ERR_CERT_COMMON_NAME_INVALID

前端 未结 8 1918
天命终不由人
天命终不由人 2021-02-04 06:32

I am facing strange issue on chrome while debugging local ASP.NET application on chrome. I am not able to open localhost without https. With Https it\'s giving

8条回答
  •  终归单人心
    2021-02-04 07:28

    I had similar problem when I tried to use my self signed certificate and run my xhtml app in browser under https and with tomcat. What I did:

    1. in java's RE dir (usually Program Files\Java\jre1.8.0_202\bin) there is keytool and in command line I used this:

      keytool -genkey -alias example -keyalg RSA -sigalg SHA256withRSA -keysize 2048 -validity 3650 -keystore "C:\yourdir\yourkeystore.jks" -ext san=dns:localhost,dns:yourdesktophostname,ip:127.0.0.1,ip:::1
      

    Answer questions to create certificate which is created for 10 years, SHA-2 and what Chrome needs more: san(SubjectAlternateName).

    1. I added below lines to tomcat's server.xml (usually Program Files\Apacha Software...\conf:

      
      

      Restart Tomcat.

    2. Open the localhost address in Chrome browser (https:\localhost:yourport). It will tell "Not secure" at left side of address line and https crossed out Click on it and in that window press on certificate (invalid). It opens the certificate window and press on Details tab and press on copy to file button. Create crt file as instructed.

    3. Open up Chrome Settings > Show advanced settings > HTTPS/SSL > Manage Certificates. Select Trusted Roots tab and import the crt file here. Edit this certificate and mark all check boxes.

    Restart Chrome

提交回复
热议问题