locked
Is there some samples available that show both the client and server side of a sockets connection using C++? The only complete samples are in C# which I can not use.

    Question

  • I need to be able to setup both the server and client side using SSL/TLS and and an external certificate.  There doesn't apper to be any complete examples using C++
    Friday, September 28, 2012 9:34 PM

Answers

  • Hi JES1945,

    You can only use SSL/TLS connection with StreamSocket object as the client in the SSL/TLS negotiation. SSL/TLS cannot currently be used by the StreamSocketListener with the StreamSocket created when a connection is received to enable SSL/TLS on the StreamSocket created, since the SSL/TLS negotiation as a server is not implemented for a StreamSocket. The client support for SSL/TLS does not include the ability to use client certificates.

    Following links may be helpful. StreamSocket sample  and Secure socket connections with TLS/SSL.


    • Edited by Mokarrom Hossain Saturday, September 29, 2012 3:45 AM
    • Proposed as answer by Jesse Jiang Monday, October 01, 2012 7:00 AM
    • Marked as answer by Jesse Jiang Thursday, October 04, 2012 2:39 AM
    Saturday, September 29, 2012 3:34 AM

All replies

  • Hi JES1945,

    You can only use SSL/TLS connection with StreamSocket object as the client in the SSL/TLS negotiation. SSL/TLS cannot currently be used by the StreamSocketListener with the StreamSocket created when a connection is received to enable SSL/TLS on the StreamSocket created, since the SSL/TLS negotiation as a server is not implemented for a StreamSocket. The client support for SSL/TLS does not include the ability to use client certificates.

    Following links may be helpful. StreamSocket sample  and Secure socket connections with TLS/SSL.


    • Edited by Mokarrom Hossain Saturday, September 29, 2012 3:45 AM
    • Proposed as answer by Jesse Jiang Monday, October 01, 2012 7:00 AM
    • Marked as answer by Jesse Jiang Thursday, October 04, 2012 2:39 AM
    Saturday, September 29, 2012 3:34 AM
  • Thanks for the suggestion, I did stumble on the example you mentioned but the problem is that I need to be able to do both the client and server side of an SSL/TLS connection.  The code I am working on was written 12 years ago and is not a standard "Web" application.  It would be nice if Winsock supported SSL/TLS in a reasonabel manner like it does in Windows CE.  I am dealing with none OOP code (unmanaged memory) so that makes it even more "fun".
    Saturday, September 29, 2012 4:24 AM