2017-06-29 6 views
0

TLS1.1によって保護されたリモートWebサービスと通信する必要があるクライアントアプリケーションがあります。サーバーとクライアントの証明書がどのように動作するように設定するのかと思います。私の知る限り、これはアプリケーション全体の証明書を、無効に恐ろしい考えです理解しセキュリティで保護されたWebサービスの呼び出しをC#(ウィンドウ)で実装する

ServicePointManager .ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;

、その後

WebServiceProxy.AddClientCertificate(cert, password);

:私たちは、Webサービス・ベンダーからのサンプルを以下ました。私の知る限り、アプリケーションにはtls/sslの設定は必要ありません。正しいストアに証明書をインストールし、http.sysがハンドシェイク中にそれらをネゴシエートする必要があります。私は正しいですか?

AFAIKリモートWebサービス証明書はThird-Party Root Certification Authoritiesで、クライアント証明書はClient Authenticationストアにある必要があります。私は正しいですか?

答えて

1

あなたは正しいですか?

クライアント証明書をCurrentUser \ MyまたはLocalMachine \ Myストアにインストールするのが理想的です。中間CA証明書はクライアント証明書からAIAを使用してフェッチされ、ルートCA証明書は既に信頼ルートストアに格納されています。同じことがサーバー証明書にも適用され、誰もが働いて幸せになれるでしょう。

あなたは

ServicePointManager 
    .ServerCertificateValidationCallback += 
    (sender, cert, chain, sslPolicyErrors) => true; 

は、証明書の検証を無効にするWebサービス・ベンダーから得たコード。あなたはMitM攻撃の脆弱ですが、通信はまだ暗号化されています:)

このコードが適用されている理由は分かりません。 Webサービスベンダーが公開していないカスタムCAを使用している可能性があります.CRLエンドポイントは公開されていません。

あなたはこのコード

ServicePointManager.SecurityProtocol = (SecurityProtocolType)LocalSecurityProtocolType.Tls11; 

/// <summary> 
/// Imported from .NET 4.6.1 : Specifies the security protocols that are supported by the Schannel security package. 
/// </summary> 
[Flags] 
public enum LocalSecurityProtocolType 
{ 
    /// <summary> 
    /// Specifies the Secure Socket Layer (SSL) 3.0 security protocol. 
    /// </summary> 
    Ssl3 = 48, 

    /// <summary> 
    /// Specifies the Transport Layer Security (TLS) 1.0 security protocol. 
    /// </summary> 
    Tls = 192, 

    /// <summary> 
    /// Specifies the Transport Layer Security (TLS) 1.1 security protocol. 
    /// </summary> 
    Tls11 = 768, 

    /// <summary> 
    /// Specifies the Transport Layer Security (TLS) 1.2 security protocol. 
    /// </summary> 
    Tls12 = 3072 
} 
を使用してクライアントにTLS1.1を設定することができます
関連する問題