title: Enable WCF replay detection cache with certificate based message security
body: <p>I have a WCF service that has the following requirements:</p>
  
  <ul>
  <li>Sent over SSL (HTTPS Transport)</li>
  <li>Reliable Messaging On</li>
  <li>WS-* message security using a X.509 certificate.</li>
  <li><strong>Replay Detection On</strong></li>
  </ul>
  
  <p>Here is the binding that I have:</p>
  
  <pre><code>  &lt;customBinding&gt;
      &lt;binding name="replayDetectionBinding"&gt;
        &lt;reliableSession /&gt;
        &lt;security authenticationMode="SecureConversation"&gt;
          &lt;secureConversationBootstrap authenticationMode="CertificateOverTransport"
            protectTokens="true"&gt;
            &lt;issuedTokenParameters keyType="AsymmetricKey" /&gt;
          &lt;/secureConversationBootstrap&gt;
          &lt;localServiceSettings maxClockSkew="00:01:00"
            replayWindow="00:01:00" /&gt;
        &lt;/security&gt;
        &lt;textMessageEncoding /&gt;
        &lt;httpsTransport maxReceivedMessageSize="5242880" maxBufferSize="5242880" /&gt;
      &lt;/binding&gt;
    &lt;/customBinding&gt;
  </code></pre>
  
  <p>The service is hosted in IIS and I have a test client to make a request to the service.  I have Fiddler up and running to catch all messages coming to and from the test client and the WCF service.  </p>
  
  <p>Everything is working, including the replay detection outside of the replay window. However, what I need is to have the replay detection use the nonce cache so that an identical message is rejected no matter what (as long as that message signature is in the nonce cache).  This part is not happening.  </p>
  
  <p>I send a message using the test client, it is received by the WCF service and a response is returned, I <strong>do not</strong> close the connection.  I then use Fiddler to reissue/replay the message that was sent.  In this case, it is accepted by fiddler - even if I issue it from another machine.</p>
  
  <p>I've done so much searching and have read just about everything I can find, but cannot get this to work.</p>
  
  <p>Does anyone know how to enable the nonce cache in this case or do you have to code your own?</p>