SslStream AuthenticateAsServer The credentials supplied to the package were not recognized
<p>Using c# to communicate via SSL with SslStream.  I am using certificates generated myself and imported into Windows certificate store w/ certlm.msc.  I am getting the following exception "The credentials supplied to the package were not recognized" on SslStream.AuthenticateAsServer().</p>

<p>It seems to work for a little while, but then it stops.  It's been pretty frustrating.  I have read through many articles here but have not found a solution I need to recreate the certificates and import them.  I created the certificates like this:</p>

<ol>
<li><p>Created a CA:</p>

<blockquote>
  <p>"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe" ^
  -n "CN=CARoot" -r -pe -a sha512 -len 4096 -cy authority -sv CARoot.pvk ^
  -ss -sr CARoot.cer</p>
  
  <p>"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\pvk2pfx.exe" ^
  -pvk CARoot.pvk -spc CARoot.cer -pfx CARoot.pfx -po Test123</p>
</blockquote></li>
<li><p>Create a Server certificate:</p>

<blockquote>
  <p>"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe" ^
  -n "CN=%1" -iv CARoot.pvk -ic CARoot.cer -pe -a sha512 -len 4096 ^
  -sky exchange -eku 1.3.6.1.5.5.7.3.1 -sv SslServer.pvk SslServer.cer</p>
  
  <p>"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\pvk2pfx.exe" ^
  -pvk SslServer.pvk -spc SslServer.cer -pfx SslServer.pfx ^
  -po Test123</p>
</blockquote></li>
<li><p>Create a client certificate:</p>

<blockquote>
  <p>"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe" ^
  -n "CN=%1" -iv CARoot.pvk -ic CARoot.cer -pe -a sha512 ^
  -len 4096 -sky exchange -eku 1.3.6.1.5.5.7.3.2 -sv SslClient.pvk ^
  SslClient.cer</p>
  
  <p>"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\pvk2pfx.exe" ^
  -pvk SslClient.pvk -spc SslClient.cer -pfx SslClient.pfx -po Test123</p>
</blockquote></li>
</ol>

<p>I am basically using the sample code from MSDN, and I put both SslServer and SslClient in my lmhosts file so they resolve.</p>

<p>Note - in Certificate Manager, when i click on them, they say "You have a private key that corresponds to this certificate".</p>