2013-12-17 22 views
2

我現在正在工作的項目是觀察和分析服務器和人之間的通信(使用wireshark),以便我們可以在此之後解密它。由於我們在服務器上有太多問題,所以我們在本地虛擬化了「服務器」。這是我們之前嘗試過的一些工作。它不是盛大的或特殊的東西,但它現在根本不起作用。當我嘗試驗證我的CA和證書時,它有一些錯誤。我使用了名爲tinyCA2的程序,並使用了此鏈接中顯示的toturial,它告訴您如何創建根CA,子CA,子Ca鏈,服務器證書和密鑰。使用openssl和證書的客戶端 - 服務器通信問題

http://theworldofapenguin.blogspot.com.au/2007/06/create-your-own-ca-with-tinyca2-part-1.html

在此之後被創建我有開2個端子(在Ubuntu)和編碼這樣的:

服務器

openssl s_server -cert [email protected] -key [email protected] -WWW -cipher RC4-MD5 -no_ticket -accept 443 -CAfile sub-CA-cachain.pem-Verify 2 

那些服務器啓動並運行(它dosnt),我們創建了一個簡單的html文件(testssl.html),其中包含一些tekst和另一個簡單的html文件的鏈接。 with openssl我們是否希望「客戶端」連接到「服務器」並執行GET請求。

openssl s_client -CAfile sub-CA-cachain.pem -connect 127.0.0.1:443 -cert [email protected] -key [email protected] 

這樣做,我們應該能夠看到客戶端和服務器之間的通信。 但沒有任何反應,因爲他們不能溝通。出於這個原因,我試圖通過像下面那樣做openssl驗證cert.pem來驗證CA,並且得到了我的結果。

根CA:

[email protected]:~/Skrivebord/NETS_certificates$ openssl verify ROOTCA-cacert.pem 

ROOTCA-cacert.pem: C = DK, L = Ballerup, O = DTU, CN = ROOTCA, emailAddress = [email protected] 
error 18 at 0 depth lookup:self signed certificate 
OK 

子CA:

[email protected]:~/Skrivebord/NETS_certificates$ openssl verify sub-CA-cachain.pem 
sub-CA-cachain.pem: C = DK, L = Ballerup, O = DTU, CN = ROOTCA, emailAddress = [email protected] 
error 18 at 0 depth lookup:self signed certificate 
OK 

Web服務器證書:

[email protected]:~/Skrivebord/NETS_certificates$ openssl verify [email protected] 
[email protected]: C = DK, L = Ballerup, O = DTU, CN = [email protected], emailAddress = [email protected] 
error 20 at 0 depth lookup:unable to get local issuer certificate 

Web服務器關鍵:

[email protected]:~/Skrivebord/NETS_certificates$ openssl verify [email protected] 
unable to load certificate 
140342585804448:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: TRUSTED CERTIFICATE 

我能做些什麼來完成這項工作?

回答

0

嘗試將根CA子CA爲 「-CAfile」 命令結合

cat Root-CA.pem Sub-CA.pem > Combined.pem 
openssl verify -CAfile Combined.pem webserver-cert.pem