[英]How to include two SSL certificates in C# request
I'm trying to connect to Java web service with C# client. 我正在尝试使用C#客户端连接到Java Web服务。 I don't have physical access to that service, but I was told by it's developers that I need to provide client certificate AND intermediate CA in my requests. 我没有对该服务的物理访问权,但是它的开发人员告诉我,我需要在请求中提供客户端证书和中间CA。
I tried using Service Reference and WebClient but I only managed to send just client certificate. 我尝试使用Service Reference和WebClient,但仅设法仅发送客户端证书。
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address);
request.ClientCertificates.Add(m_TransportCertificate);
//m_TransportCertificate holds client certificate with key and rest of the cert chain (intermediate and root)
return request;
}
How to send two client certificates in C#? 如何在C#中发送两个客户端证书? As far as i know it isn't normal behaviour - client should only send one certificate. 据我所知,这是不正常的行为-客户只能发送一份证书。
I can't make my app to do it - it always sends one certificate. 我无法让我的应用执行此操作-它总是发送一个证书。 Wireshark screenshot Wireshark屏幕截图
However it works in SoapUI (the second one is intermediate CA) Wireshark screenshot 但是它可以在SoapUI中工作(第二个是中间CA) Wireshark屏幕截图
I found a solution. 我找到了解决方案。 Intermediate CA was automatically installed in Intermediate Certification Authorities but it needs to be in Trusted Root Certification Authorities . 中级CA自动安装在中级证书颁发机构中,但它必须位于受信任的根证书颁发机构中 。
Just moved it there and it worked. 只是将其移到那里就可以了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.