HttpListenerRequest.ClientCertificateError プロパティ
アセンブリ: System (system.dll 内)
構文Windows エラー コードを格納している Int32 値。
解説このプロパティには、証明書の検証に使用される、Schannel (Secure Channel) の SSPI (Security Support Provider Interface) から返される Windows エラー コードが格納されます。Schannel の SSPI サポートの詳細については、http://msdn.microsoft.com/library にあるセキュリティに関するドキュメントの「Creating a Secure Connection Using Schannel」を参照してください。
使用例このプロパティをチェックして、要求に有効なクライアント証明書が含まれているかどうかを確認するコード例を次に示します。
Console.WriteLine("Listening for {0} prefixes...", listener.Prefixes.Count);
HttpListenerContext context = listener.GetContext();
HttpListenerRequest request = context.Request;
Console.WriteLine("Received a request.");
// This server requires a valid client certificate
// for requests that are not sent from the local computer.
// Did the client omit the certificate or send an invalid certificate?
if (request.IsAuthenticated &&
request.GetClientCertificate() == null ||
request.ClientCertificateError != 0)
{
// Send a 403 response.
HttpListenerResponse badCertificateResponse = context.Response ;
SendBadCertificateResponse(badCertificateResponse);
Console.WriteLine("Client has invalid certificate.");
continue;
}
プラットフォームWindows 98, Windows Server 2003, Windows XP Media Center Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照Weblioに収録されているすべての辞書からHttpListenerRequest.ClientCertificateError プロパティを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からHttpListenerRequest.ClientCertificateError プロパティ
を検索
- HttpListenerRequest.ClientCertificateError プロパティのページへのリンク