顯示具有 ssl 標籤的文章。 顯示所有文章
顯示具有 ssl 標籤的文章。 顯示所有文章

2023年10月23日

確認憑證和私鑰是否匹配

環境 1.Ubuntu 20.04 2.OpenSSL 1.1.1f 指令
crt - 憑證檔(含公鑰)
$sudo openssl x509 -noout -modulus -in my-server.crt |openssl md5
(stdin)= e9af4bcf8a1af623da89acc78c60f82e
key - 私鑰
$sudo openssl rsa -noout -modulus -in my-server.key |openssl md5
(stdin)= e9af4bcf8a1af623da89acc78c60f82e
csr - 憑證簽章要求
$openssl req -in my-server.csr -noout -modulus | openssl md5
(stdin)= e9af4bcf8a1af623da89acc78c60f82e

2017年7月15日

wget 出現 WARNING: certificate common name `www.github.com' doesn't match requested host name `raw.githubusercontent.com'

想要定時在 Linux 下用 wget 抓 github 上面某支檔案
結果卻出現
[root@srv qoo]# wget --spider --no-check-certificate https://raw.githubusercontent.com/***********
--15:28:50-- https://raw.githubusercontent.com/***********
Resolving raw.githubusercontent.com... 151.101.88.133
Connecting to raw.githubusercontent.com|151.101.88.133|:443... connected.
WARNING: certificate common name `www.github.com' doesn't match requested host name `raw.githubusercontent.com'.
HTTP request sent, awaiting response... 200 OK
Length: 181940 (178K) [text/plain]
200 OK


google 以後發現是某些版本 wget 的問題、並建議可以改用 curl 來下載檔案
curl -L --remote-name https://raw.githubusercontent.com/***********


當然也可以使用 git 來做、只是抓個檔案而以、就順手寫 script 用 wget 了

reference:https://confluence.atlassian.com/jirakb/error-certificate-common-name-doesn-t-match-requested-host-name-737771971.html