title: SSL WCFs with custom binding
body: <p>Has anyone ever tried to use custom binding with SSL in a WCF web service?  I've seen a number of examples on how to do this with basicHttpBinding and wsHttpBinding but the equivalent always fails for customBinding.  Specifically what I'm currently working with (the most successful configuration yet) looks something like this:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"&gt;
      &lt;/serviceHostingEnvironment&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="MyServiceBehavior"&gt;
            &lt;serviceMetadata httpsGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;customBinding&gt;
          &lt;binding name="binaryHttps"&gt;
            &lt;binaryMessageEncoding /&gt;
            &lt;httpsTransport /&gt;
          &lt;/binding&gt;
        &lt;/customBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="MyServiceBehavior" name="MyService"&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="https://(myserver)/"/&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
          &lt;endpoint address=""
        binding="customBinding" bindingConfiguration="binaryHttps"
        contract="MyService" /&gt;
          &lt;endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>This actually allows us to access the service from the web, get it's WSDL and add a service reference inside visual studio alright, but when we actually try and use it live in our silverlight-3 application, it just sits there indefinitely waiting for a response and never times out.  It actually ends up giving me low memory problems after a while on my machine (with 6GB of memory).  The odd thing is that all this worked (and still does) perfectly in the development environment (using strictly the VS application hosts), it wasn't until we tried to deploy it to an actual server with a real SSL certificate that all these issues popped up.</p>
  
  <p>I've searched fairly exhaustively for a solution to this problem but have so far not found anything and have tried just about everything - Is there anyone out there that's encountered this before and got around it?</p>