伺服器憑證主題名稱中缺少 commonName 屬性

伺服器憑證主題名稱中缺少 commonName 屬性

我正在嘗試設定 SSL SVN 伺服器,當我嘗試遠端結帳時出現錯誤Server certificate was missing commonName attribute in subject name

我做了一些谷歌搜索,據我所知,我需要添加我正在訪問的 URL 的 IP 位址,如下所示的openss.cnf屬性commonName。我這樣做了,但仍然收到錯誤。

commonName                      = xx.xxx.xx.xx
commonName_max                  = 64

答案1

聽起來 CommonName 與 SSL 憑證不符。您的 SSL 憑證中的 CN 與您的伺服器相符嗎?

您可以執行以下命令來查看 SSL 憑證:

openssl x509 -noout -text -in ssl.crt

編輯

要產生萬金油證書,首先產生密鑰:

openssl genrsa -out host.key 1024

現在產生證書:

openssl req -new -key host.key -x509 -days 3650 -out host.crt

openssl 將提示您輸入資訊:

Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:

通用名是您指定伺服器主機名稱的地方。

相關內容