11 #ifndef __DRIFT_GNUTLS_H__
12 #define __DRIFT_GNUTLS_H__
14 #include <drift/sockets3.h>
16 #if defined(DSL_DLL) && defined(WIN32)
17 #if defined(DSL_GNUTLS_EXPORTS)
18 #define DSL_GNUTLS_API extern "C" __declspec(dllexport)
19 #define DSL_GNUTLS_API_CLASS __declspec(dllexport)
21 #define DSL_GNUTLS_API extern "C" __declspec(dllimport)
22 #define DSL_GNUTLS_API_CLASS __declspec(dllimport)
25 #define DSL_GNUTLS_API DSL_API_VIS
26 #define DSL_GNUTLS_API_CLASS DSL_API_VIS
31 gnutls_session_t gtls = NULL;
32 bool ssl_is_client =
false;
38 virtual int pRecv(
DSL_SOCKET * sock,
char * buf, uint32 bufsize);
39 virtual int pPeek(
DSL_SOCKET * sock,
char * buf, uint32 bufsize);
40 virtual int pSend(
DSL_SOCKET * sock,
const char * buf, uint32 bufsize);
41 virtual int pSelect_Read(
DSL_SOCKET * sock, timeval * timeo);
44 gnutls_session_t ctx = NULL;
45 gnutls_certificate_credentials_t gnutls_cred;
50 virtual bool EnableSSL(
const char * cert_fn,
DS3_SSL_METHOD method);
51 virtual bool SwitchToSSL_Server(
DSL_SOCKET * sock);
52 virtual bool SwitchToSSL_Client(
DSL_SOCKET * sock);
54 virtual gnutls_session_t GetSSL_CTX();