<p>I would like to create an SSL connection for generic TCP communication.  I think I figured out how to do it in the code, using the info here: <a href="http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx</a>
What I'm having trouble with is creating a cert so I can test this out.  I tried makecert.exe testCert, and that created a cert, but apparently it doesn't have a private key associated with it.  So what I'm looking for is the simplest procedure to create a cert and get the connection to work.</p>

[{'answer_id': 20946, 'author': 'ScArcher2', 'author_id': 1310, 'author_profile': 'https://Stackoverflow.com/users/1310', 'pm_score': 1, 'selected': False, 'text': '<p>I asked a similar question referencing apache, but someone linked to a microsoft howto on the response. It may be helpful.</p>\n\n<p><a href="https://stackoverflow.com/questions/18034/how-do-i-create-a-self-signed-ssl-certificate-to-use-while-testing-a-web-app">Here</a></p>\n'}, {'answer_id': 22173, 'author': 'Bill the Lizard', 'author_id': 1288, 'author_profile': 'https://Stackoverflow.com/users/1288', 'pm_score': 3, 'selected': True, 'text': '<p>I haven\'t found a <em>simple</em> way to do this yet, but I found <a href="http://www.herongyang.com/crypto/openssl_crt.html" rel="nofollow noreferrer">this site</a> helpful a few months back.</p>\n\n<p>O\'Reilly also published a book called Network Security Hacks (available on Safari) that has a section starting at Hack #45 on creating your own certificate authority.</p>\n'}, {'answer_id': 645929, 'author': 'sipsorcery', 'author_id': 75658, 'author_profile': 'https://Stackoverflow.com/users/75658', 'pm_score': 0, 'selected': False, 'text': '<p>For anybody else attempting this the pkcs12 certificate created as detailed here <a href="https://stackoverflow.com/questions/440762/openssl-command-line-troubles">openssl question</a> and using the X509Certificate2.CreateFromCertFile method gets past the private key problem. Note I used openssl with cygwin on Windows.</p>\n'}]
['https://Stackoverflow.com/questions/20791', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2348/']