Trang chủ » Diễn Đàn » Lập trình và Phát triển Web » Microsoft .NET » Do I need to use X509Chain to veryfy ServerCertificate.
Chủ đề đã bị khóa, bạn không thể xóa, sửa hay trả lời trong chủ đề này!
|
|
|---|
|
0
Hi,
I wand to make the SSL connection to https my website( maybe webservice). Of course I use Certificate and Key Exchange to secure Client/Server connection But I want only my program to access to https my website So I call private X509Certificate2 verifyCert = null; string defaultGatewayCa = "-----BEGIN CERTIFICATE-----\nUE\AUIfkDWGqpg2QR\n-----END CERTIFICATE-----\n"; this.verifyCert = Util.GetCertFromstring(defaultGatewayCa); ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(ServerCertificateValidation); private bool ServerCertificateValidation(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return verifyCert.Verify(); } Now the question is: I verify Server Certificate signature by using CA certificate ( I assume that this CA has signed Server Certificate) So do I need X509Chain to veryfy CA certificate up to Root CA? I don't think I need to use X509Chain, but what purpose X509Chain parameter in delegate function is about? |
