为什么 .net 核心不支持 TransportWithMessageCredential?

sud*_* pk 10 c# wcf soap client-certificates .net-core

我正在尝试在 .net core 中使用 SOAP 服务

我想将安全模式的基本 httpbinding 设置为 TransportWithMessageCredential

和 clientcredentialType 作为证书

但我收到一个错误

在此上下文中,绑定安全属性“securityMode”不支持值“TransportWithMessageCredential”。

代码看起来像这样

var client = new SoapCustomClient();

var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
client.ClientCredentials.ClientCertificate.Certificate = certCollection[0];
Run Code Online (Sandbox Code Playgroud)

我在这里犯了一些严重的错误吗?任何解决方案?

[我能够在 .net 框架中实现这一点,但不能在 .net 核心中实现]

Jar*_*rda 3

这个问题在较新版本的 System.ServiceModel.* 包中得到了解决(4.7.0 对我有用)。

请参阅https://github.com/dotnet/wcf/issues/4045#issuecomment-577854822