我正在使用SslStream提供其SSL套接字的.Net服務器應用程序。它適用於一些客戶端(如基於libcurl的客戶端),但其他客戶端由於缺乏中間證書而引發錯誤。我如何將中間證書與SslStream或X509Certificate2對象相關聯以使這些客戶端感到滿意?在服務器應用中對SslStream和X509Certificate2使用中間證書
下面是我使用的是現在,接受連接時的代碼:
X509Certificate2 cert = new X509Certificate2("cert.pfx", "");
theSslStream.BeginAuthenticateAsServer(cert, ...);
如果我使用OpenSSL我有SSL_CTX_add_extra_chain_cert()
做到這一點。我已經看過X509Chain對象,但看不到如何使它適合。
謝謝。
這確實是我們需要做的!我們使用: openssl pkcs12 -in cert.pfx -out cert.pem -nodes ...編輯cert.pem將私鑰放入它自己的文件cert.key中。下載了中級證書(來自Go Daddy,gd_bundle.crt)。 openssl pkcs12 -export -in cert.pem -inkey cert.key -out cert_new.pfx -CAfile gd_bundle.crt -chain 然後cert_new.pfx可以用於創建X509Certificate2對象,這似乎使客戶端有疑問更快樂。 – 2009-10-16 18:33:56