title: Native SSL Support for WINAPI
body: <p>I'm trying to make a simple IRC client, using the Winsock API, to which I want to add SSL support. Currently I just use overlapped socket I/O like this:</p>
  
  <pre><code>SOCKET sock = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0x02, 0x01);
  
  if (!sock)
      return;
  
  struct sockaddr_in ircClient;
  
  memcpy(&amp;ircClient.sin_addr, he-&gt;h_addr_list[0], he-&gt;h_length);
  ircClient.sin_family = AF_INET;
  ircClient.sin_port = wPort;
  
  WSAEVENT hDataEvent = WSA_INVALID_EVENT;
  
  if (WSAConnect(sock, (sockaddr*)&amp;ircClient, sizeof(ircClient), 0, 0, 0, 0) &gt; 0) {
      closesocket(sock);
      return;
  }
  
  if (wsWSAGetLastError() != 0) {
      closesocket(sock);
      return;
  }
  </code></pre>
  
  <p>Now, as I understand, for SSL support, I need to do SSL handshake after <code>WSAConnect()</code>.  I found old Internet posts saying there are no SSL support in Winsock.  It is now is year 2017, and 95% of websites work with SSL.  Is there still no way to do this?  I have found <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb394814.aspx" rel="nofollow noreferrer">Using Secure Socket Extensions</a>, but it is not SSL.</p>