00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __SOCKETS_SSLInitializer_H
00034 #define __SOCKETS_SSLInitializer_H
00035 #include "sockets-config.h"
00036 #ifdef HAVE_OPENSSL
00037
00038 #ifdef _WIN32
00039 #include <winsock2.h>
00040 #endif
00041 #include <openssl/ssl.h>
00042 #include <string>
00043 #include <map>
00044 #include "Mutex.h"
00045
00046
00047 #ifdef SOCKETS_NAMESPACE
00048 namespace SOCKETS_NAMESPACE {
00049 #endif
00050
00051
00052 class SSLInitializer
00053 {
00054 public:
00060 SSLInitializer();
00061
00065 ~SSLInitializer();
00066
00067 void DeleteRandFile();
00068
00070 static void SSL_locking_function(int mode, int n, const char *file, int line);
00071
00073 static unsigned long SSL_id_function();
00074
00075 BIO *bio_err;
00076
00077 private:
00078 std::string m_rand_file;
00079 long m_rand_size;
00080 static std::map<int, IMutex *> *m_mmap;
00081 static Mutex *m_mmap_mutex;
00082
00083 static std::map<int, IMutex *>& MMap();
00084 static Mutex& MMapMutex();
00085
00086 };
00087
00088
00089
00090
00091 #ifdef SOCKETS_NAMESPACE
00092 }
00093 #endif
00094 #endif // HAVE_OPENSSL
00095 #endif // __SOCKETS_SSLInitializer_H
00096