26 #ifndef SECURE_SOCKET_H
27 #define SECURE_SOCKET_H
29 #ifdef COMPILE_WITH_SSL
31 #include <openssl/ssl.h>
32 #include <openssl/rand.h>
39 #include "dynamicssllocking.h"
40 #include "staticssllocking.h"
48 #define CIPHER_LIST "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"
53 class SecureSocket :
public Socket
56 SecureSocket(
const SecureSocket &);
58 SecureSocket & operator=(
const SecureSocket &);
62 virtual void Init(
int port);
69 SecureSocket(
const std::string & certfile =
"",
73 virtual ~SecureSocket();
79 virtual bool IsSecure()
const {
return true; }
81 virtual int Read(
void *buf,
int bufsize);
83 virtual int Send(
const void *buf,
size_t buflen,
int flags = 0);
87 virtual void ThreadCleanup();
101 static int PassphraseCallback(
char * buf,
int bufsize,
int rwflag,
void * userdata);
109 SecureSocket(SSL *ssl, ehs_socket_t fd, sockaddr_in *peer);
112 SSL_CTX *InitializeCertificates();
120 std::string m_sCertFile;
128 static DynamicSslLocking * s_pDynamicSslLocking;
131 static StaticSslLocking * s_pStaticSslLocking;
134 static SslError * s_pSslError;
137 static SSL_CTX * s_pSslCtx;
140 static int s_refcount;
143 static pthread_mutex_t s_mutex;
Abstracts different socket types.
This interface describes a handler for retrieving passphrases.
plain socket implementation of NetworkAbstraction