wip kylef/tls
authorKyle Fuller <redacted>
Tue, 11 Aug 2015 00:01:07 +0000 (01:01 +0100)
committerKyle Fuller <redacted>
Tue, 11 Aug 2015 00:01:07 +0000 (01:01 +0100)
palaver.cpp

index c48e2ce531363eaa443704e8e6cc9417b903463a..b78e31c65ea34290bc7d9b3ceb0a579bee067c59 100644 (file)
 #define CSOCKET_DOES_NOT_HAVE_SNI_CONFIGURATION
 
 static int PalaverSNICallBack(SSL *pSSL, int *piAD, void *pData) {
+       if (!pSSL || !pData) {
+               return SSL_TLSEXT_ERR_NOACK;
+       }
 
+       PLVHTTPSocket *pSock = static_cast<PLVHTTPSocket *>(pData);
 }
 #endif
 
@@ -180,8 +184,14 @@ public:
        }
 
 #ifdef CSOCKET_DOES_NOT_HAVE_SNI_CONFIGURATION
-       bool AcceptSSL() {
-               return CSocket::AcceptSSL();
+       bool SSLClientSetup() {
+               bool result = CSocket::SSLClientSetup();
+
+               if (result) {
+                       SSL_set_tlsext_host_name(GetSSLObject(), m_pHostname.c_str());
+               }
+
+               return result;
        }
 #endif
 
git clone https://git.99rst.org/PROJECT