
我在使用 openvpn 時遇到一些問題,我想驗證客戶端的連線金鑰。我找到了許多有關如何驗證伺服器金鑰的範例:
linux-3kfe:/usr/share/easy-rsa/keys # openssl x509 -noout -modulus -in server.crt | openssl md5
(stdin)= beddfdbb495c246fff85b852f150f896
linux-3kfe:/usr/share/easy-rsa/keys # openssl rsa -noout -modulus -in server.key | openssl md5
(stdin)= beddfdbb495c246fff85b852f150f896
linux-3kfe:/usr/share/easy-rsa/keys # openssl req -noout -modulus -in server.csr | openssl md5
(stdin)= beddfdbb495c246fff85b852f150f896
但沒有明確的方法來驗證客戶端的連線金鑰:
linux-3kfe:/usr/share/easy-rsa/keys # openssl req -noout -modulus -in client1.key | openssl md5
unable to load X509 request
140312459372176:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: CERTIFICATE REQUEST
(stdin)= d41d8cd98f00b204e9800998ecf8427e
linux-3kfe:/usr/share/easy-rsa/keys # openssl req -noout -modulus -in client1.csr | openssl md5
(stdin)= a78884d4c1010f599a6801b2f3b76d85
linux-3kfe:/usr/share/easy-rsa/keys # openssl req -noout -modulus -in client1.crt | openssl md5
unable to load X509 request
139712641472144:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: CERTIFICATE REQUEST
(stdin)= d41d8cd98f00b204e9800998ecf8427e
如何在伺服器(例如 openvpn)之外驗證客戶端 ssl rsa 金鑰,以測試客戶端金鑰是否正確產生?
我嘗試使用 easy-rsa 金鑰來建立一個測試伺服器。我不確定我是否做對了 https://bpaste.net/show/543cbd43aa1a
這是否意味著我的密鑰產生不正確?
答案1
對於密鑰:您已用於openssl req [sign request]
每個客戶端密鑰測試。相反,請嘗試與您對伺服器所做的相同的操作,即。openssl rsa -noout -modulus -in client1.key
對於 OpenVPN 配置,日誌檔案說明了一切:
警告:同時使用 --pull/--client 和 --ifconfig 可能不是您想要的
你什麼做想要的就是ifconfig
從客戶端配置中刪除不正確的值,並讓伺服器push
為您提供正確的值。也許您想回顧一下官方指南