1

このコード行を実行するカスタム メッセージ インスペクターがあります。

 public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
 {
     MessageBuffer contextPatch = request.CreateBufferedCopy(1024 * 128);
     ...
 }

セキュリティが有効になっていない場合はCreateBufferedCopy正常に動作しますが、SSL が構成されている場合は InvalidOperationException がスローされます。Message request例外は、オブジェクトが「書き込み済み」状態にあることを主張します。これらすべての構成は次のとおりです。

  <serviceBehaviors>
    <behavior>
      <serviceCredentials>
        <clientCertificate>
          <authentication certificateValidationMode="PeerTrust" />
          <certificate findValue="sigtest.arbit.com" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
        </clientCertificate>
        <serviceCertificate findValue="sigtest.arbit.com" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
      </serviceCredentials>
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
      <serviceSecurityAudit auditLogLocation="Application" messageAuthenticationAuditLevel="Failure" serviceAuthorizationAuditLevel="Failure" suppressAuditFailure="true" />
      <endToEndLogging traceKeys="CorrelationId|correlationId" createDefaultRequestValue="false" />
    </behavior>
  </serviceBehaviors>

これは、WCF 自体のバグのようです。つまり、Message requestパラメーターを (SSL 機能によって?) 「書き込み済み」状態のままにしないでください。考え?

関連する場合に備えて、カスタム バインディングが SSL に使用されました。

  <customBinding>
    <binding name="myCustomBinding">
      <security defaultAlgorithmSuite="Default" authenticationMode="MutualCertificateDuplex" enableUnsecuredResponse="true" requireDerivedKeys="false" securityHeaderLayout="Lax" includeTimestamp="true" messageProtectionOrder="EncryptBeforeSign" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" requireSignatureConfirmation="false" allowSerializedSigningTokenOnReply="true">
        <localClientSettings detectReplays="true" />
        <localServiceSettings detectReplays="true" />
      </security>
      <textMessageEncoding messageVersion="Soap11" />
      <transactionFlow />
      <httpsTransport />
    </binding>
  </customBinding>
4

0 に答える 0