要求モードで Https 用に構成された sharepoint サーバーがあります。SharePoint サーバーで WCF サービスをホストしました。この WCF サーバーは、認証にクライアント証明書を使用します。
WCF サービスはBasicHttpBinding
.
クライアント側のバインディングは次のとおりです。
BasicHttpBinding binding = new BasicHttpBinding();
binding.TransferMode = TransferMode.StreamedResponse;
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
次の呼び出しを使用してクライアント証明書も設定しました。
base.ClientCredentials.ClientCertificate.SetCertificate(
"CN=tempClientcert", StoreLocation.LocalMachine, StoreName.My
);
クライアント証明書がクライアントとサーバーに正しくセットアップされている。
サービスを呼び出そうとすると、次のエラーが発生します。
System.Security.MessageSecurityException : The HTTP request is unauthorized
with client authentication scheme 'Anonymous'. The authentication header
received from the server was 'NTLM'
クライアント資格情報を証明書に設定しましたが、http クライアント認証スキームが匿名であると言っている理由が不明です。