安全なプロトコルを使用する場合のネットワーク関連エラー


解説

特定の状況下で、Sitecore Experience Platformは自分自身に対してWebのリクエストを試行しようとします。一例を挙げると、コンテンツ エディターがkeepalive.aspxページを呼び出したり、EXMが電子メール メッセージの本文をレンダリングする場合などが該当します。

IISまたはWindowsの設定によっては、.NETフレームワークで使用される特定のSSLプロトコルを無効にすることができますが、それにより、以下のようなエラーが発生する場合があります:

The underlying connection was closed: An unexpected error occurred on a send.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

解決策

この問題を解決するには、System.Net.ServicePointManager.SecurityProtocolプロパティを変更して、更新されたプロトコルを使用する必要があります。

  1. SecurityProtocol プロパティを新しいプロトコルで更新するためのカスタム プロセッサを作成します。
    例:
    public void Process(PipelineArgs args)
    {
    System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12 | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Ssl3;
    }
  2. Web.config ファイル(Sitecore XP 8.1以降の場合はSitecore.config ファイル)の<initialize>パイプラインに、このプロセッサを追加します:
    <pipelines>
      <initialize>   ... <processor type="<your-processor-class-name, your-assembly-name" />
    </initialize>