简体   繁体   English

无法使用Asp.net Core WCF连接的服务添加多个客户端证书

[英]Cannot add multiple client certificates with asp.net core wcf connected service

Trying to call a soap web service that requires two x509 certificates. 尝试调用需要两个x509证书的Soap Web服务。

I was able to do this with .net framework project and proxy generated with wsdl.exe tool. 我能够使用.net框架项目和使用wsdl.exe工具生成的代理来做到这一点。

Now generating with new .net core proxy generators, we can only set one certificate with service and one for client 现在使用新的.net核心代理生成器生成,我们只能为服务设置一个证书,为客户端设置一个证书

//wsdl.exe generated code .. svc.ClientCertificates.Add(X509Certificate.CreateFromCertFile(settings.TheirCertPath)); //wsdl.exe生成的代码.. svc.ClientCertificates.Add(X509Certificate.CreateFromCertFile(settings.TheirCertPath)); svc.ClientCertificates.Add(X509Certificate.CreateFromCertFile(settings.OurCertPath)); svc.ClientCertificates.Add(X509Certificate.CreateFromCertFile(settings.OurCertPath));

//dotnet svc utl.exe generated code // dotnet svc utl.exe生成的代码

var factory = new ChannelFactory(binding, endpoint); var factory = new ChannelFactory(绑定,端点);

        factory.Credentials.ClientCertificate.Certificate = clientCertificate;
                  factory.Credentials.ServiceCertificate.DefaultCertificate = serverCertificate;

Any ideas on why microsoft would remove the ability to set multiple client certs? 关于Microsoft为什么会删除设置多个客户端证书的功能的任何想法?

https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/message-security-with-mutual-certificates https://docs.microsoft.com/zh-cn/dotnet/framework/wcf/feature-details/message-security-with-mutual-certificates

Your server-side mainly based on the message level security with mutual certificate. 您的服务器端主要基于具有相互证书的消息级安全性。 Currently it is not supported by Asp.net Core. 目前Asp.net Core不支持它。 Therefore, we could not generate the client proxy class by using Microsoft WCF Web Service Reference Provider. 因此,我们无法使用Microsoft WCF Web服务引用提供程序生成客户端代理类。 Please refer to the official repository issue. 请参阅官方资料库问题。
https://github.com/dotnet/wcf/issues/1354 https://github.com/dotnet/wcf/issues/1354
https://github.com/dotnet/wcf/issues/2766 https://github.com/dotnet/wcf/issues/2766
Feel free to let me know if there is anything I can help with. 请随时告诉我是否有什么我可以帮助的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM