title: self hosted wcf with ssl with webHttpBinding
body: <p>I'm have created a  self hosted WCF service that act as REST API service with webHttpBinding and support of CORS. I consume this service from the browser.</p>
  
  <p>When I tried to add https, it didn't work.</p>
  
  <p>I created the CERTS, and combine them according to this tutorial:</p>
  
  <p><a href="https://www.youtube.com/watch?v=ugpPSNxtAmY" rel="nofollow noreferrer">https://www.youtube.com/watch?v=ugpPSNxtAmY</a></p>
  
  <p>my config is:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;services&gt;
    &lt;service name="MyService.MyService"&gt;
      &lt;endpoint address="" binding="webHttpBinding" contract="MyService.IMyService" behaviorConfiguration="jsonBehavior"&gt;
        &lt;identity&gt;
          &lt;dns value="MyMachine" /&gt;
        &lt;/identity&gt;
      &lt;/endpoint&gt;
      &lt;endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;extensions&gt;
    &lt;behaviorExtensions&gt;
      &lt;add name="crossOriginResourceSharingBehavior" type="Company.Common.EnableCrossOriginResourceSharingBehavior, Company.Common" /&gt;
    &lt;/behaviorExtensions&gt;
  &lt;/extensions&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior&gt;
        &lt;!-- To avoid disclosing metadata information, 
        set the values below to false before deployment --&gt;
        &lt;serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/&gt;
        &lt;!-- To receive exception details in faults for debugging purposes, 
        set the value below to true.  Set to false before deployment 
        to avoid disclosing exception information --&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="False" /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="jsonBehavior"&gt;
        &lt;webHttp /&gt;
        &lt;crossOriginResourceSharingBehavior /&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;bindings&gt;
    &lt;webHttpBinding&gt;
      &lt;binding crossDomainScriptAccessEnabled="true" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="524288"
      transferMode="Buffered"&gt;
        &lt;readerQuotas maxDepth="32" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
        &lt;security mode="Transport"&gt;
          &lt;transport clientCredentialType="None"/&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  &lt;standardEndpoints&gt;
    &lt;webScriptEndpoint&gt;
      &lt;standardEndpoint name="" crossDomainScriptAccessEnabled="true" /&gt;
    &lt;/webScriptEndpoint&gt;
  &lt;/standardEndpoints&gt;
  &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I try to consume I got an error.
  How can I do it.
  The client of this service is a browser</p>