Google chrome Chrome 59网络::错误证书公共名称无效

Google chrome Chrome 59网络::错误证书公共名称无效,google-chrome,glassfish,ssl-certificate,keytool,Google Chrome,Glassfish,Ssl Certificate,Keytool,我在Chrome(V59.0.3071.109)上遇到了这个错误,我已经尝试了几个答案,但没有任何运气 这是“安全”选项卡中显示的内容: The certificate for this site does not contain a Subject Alternative Name extension containing a domain name or IP address There are issues with the site's certificate chain (net::E

我在Chrome(V59.0.3071.109)上遇到了这个错误,我已经尝试了几个答案,但没有任何运气

这是“安全”选项卡中显示的内容:

The certificate for this site does not contain a Subject Alternative Name extension containing a domain name or IP address
There are issues with the site's certificate chain (net::ERR_CERT_COMMON_NAME_INVALID).
我按照以下步骤创建了具有以下值的证书:

CN = localhost
OU = ort
O = ort
L = montevideo
S = MVD
C = UY
这是我的主机
https://localhost:8181/Gateway-war/

到目前为止,我已经尝试:

  • 启用此标志
    chrome://flags/#allow-不安全的本地主机
  • 将此
    --忽略证书错误
    添加到Chrome快捷方式中,会显示一条消息,表示不允许使用此命令,因为它会影响安全性和稳定性
  • 使用:
    reg add HKLM\Software\Policies\Google\Chrome/v enableComonnameFallbackorLocalanchors/t reg\u DWORD/d 1
在所有情况下,我在试用之前都重新启动了Chrome

也许我的
CN
应该不仅仅是本地主机?
任何想法都是受欢迎的

当您正确配置了证书后,您不必做所有这些变通方法来使其工作。您所要做的就是在证书中添加
SubjectAltName
扩展名,以使浏览器满意

我想您一定在使用自签名证书。如果是这样,您的证书对于“SubjectAltName”扩展名必须如下所示。您可以使用(OpenSourceGUI for
keytool
)生成如下证书:


如果是CA签名的证书,您需要确保在CSR中发送这些扩展属性。

您需要创建一个带有“Subject Alternative Name”的证书。如果使用windows,则可以使用PowerShell。证书将存储在windows注册表中。您可以通过certml.msc访问证书,然后将其导出到certmgr.msc中的驱动器。下面是通过在新的SelfSignedCertificate上使用TextExtension参数获得的具有“Subject Alternative Name”的证书示例

New-SelfSignedCertificate -CertStoreLocation cert:\LocalMachine\My -NotAfter (Get-Date).AddYears(10) -FriendlyName "My Network Name" -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -TextExtension @("2.5.29.17={text}dns=*.example.com&ipaddress=192.168.1.1")

那么,对于自签名证书,您实际上是如何做到这一点的呢?