title: SelfSSL7 custom CN with a local development domain
body: <p>I have my site mydomain.local on my local development machine, which uses a local hosts file entry to point to 127.0.0.1. The directory is my working git copy and it works like a charm. It always points to whatever I have checked out.</p>
  
  <p>I want to setup SSL but of course need to test locally and with my code before I go implementing it elsewhere. This is my Win7 Ultimate machine and this dev environment uses full-blown IIS 7.5 and not any built-in IIS express or localhost:port# auto-config.</p>
  
  <p>Through multiple experiments, I've resorted to <a href="http://blogs.iis.net/thomad/archive/2010/04/16/setting-up-ssl-made-easy.aspx" rel="nofollow">SelfSSL7</a> for greater control and setup of a self-signed SSL certificate. It has a great set of options and seems to work well. </p>
  
  <p>Accordingly to the <a href="http://blogs.iis.net/thomad/archive/2010/04/16/setting-up-ssl-made-easy.aspx" rel="nofollow">limited docs</a>, I generate my SelfSSL cert with this command:</p>
  
  <pre><code>SelfSSL7 /Q /T /I "mydomain.local" /S "MyDomain IIS Name" /N cn=pc_name;cn=localhost;cn=mydomain.local
  </code></pre>
  
  <p>It does properly bind to my IIS setup with the right domain. BUT when I try to start the Site,I get this error:</p>
  
  <pre><code>The process cannot access the file because it is being used by another process. (Exception 0x80070020)
  </code></pre>
  
  <p>I <a href="http://support.microsoft.com/kb/890015" rel="nofollow">look up these errors</a> and am instructed to check which services are listening on port 443 for SSL. This is a snippet of the output from my <code>netstat -ano</code> output (where port==443) (I've trimmed all else)</p>
  
  <pre><code>Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       5800
  TCP    [::]:443               [::]:0                 LISTENING       5800
  </code></pre>
  
  <p>Problem is that the documentation sucks (surprise) and I'm not sure where to go from here. The registry path they've specified does not actually exit on my machine (no ListenOnlyList folder in Regedit). Also, I have 0 other IIS sites setup and definitely none setup on SSL over 443. </p>
  
  <p>SUMMARY: the SSL cert can be generated, looks right, but I cannot Start the site in IIS once it's binding is in place. Again, SSL looks right - maybe it's more about my machine config with regard to port 443 and "socket pooling" (???)</p>