Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

SSLSocket.h

00001 /*
00002  *  Copyright (c) 2004 on behalf of the EU EGEE Project:
00003  *  The European Organization for Nuclear Research (CERN),
00004  *  Istituto Nazionale di Fisica Nucleare (INFN), Italy
00005  *  Datamat Spa, Italy
00006  *  Centre National de la Recherche Scientifique (CNRS), France
00007  *  CS Systeme d'Information (CSSI), France
00008  *  Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
00009  *  Universiteit van Amsterdam (UvA), Netherlands
00010  *  University of Helsinki (UH.HIP), Finland
00011  *  University of Bergen (UiB), Norway
00012  *  Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
00013  */
00014 #ifndef RGMA_SSLSOCKET_H
00015 #define RGMA_SSLSOCKET_H
00016 #define OPENSSL_NO_KRB5
00017 #include "rgma/RGMAException.h"
00018 #include "rgma/RemoteException.h"
00019 #include "rgma/TCPSocket.h"
00020 #include "rgma/SSLContext.h"
00021 #include "log4cxx/logger.h"
00022 #include "log4cxx/level.h"
00023 #include "log4cxx/helpers/loglog.h"
00024 #include "log4cxx/propertyconfigurator.h"
00025 #include "log4cxx/helpers/exception.h"
00026 #include <openssl/ssl.h>
00027 #include <sys/socket.h>
00028 #include <string>
00029 namespace glite
00030 {
00031     namespace rgma
00032     {
00037         class SSLSocket :public TCPSocket
00038         {
00039             private:
00040                 SSL* m_ssl;
00041                 SSL_SESSION* m_sslSession;
00042                 std::string m_host;
00043                 int connectionCounter;
00044                 const static int MAX_NO_OF_CONNECTIONS;
00045                 int m_port;
00046                 static SSLContext m_sslContext;
00047                 log4cxx::LoggerPtr m_ssllogger;
00048                 void establishSSL()throw(RGMAException, RemoteException);
00054                 int sslPing(SSL *ssl, int socket);
00060                 void reMakeSSLConnection() throw(RGMAException, RemoteException);
00061                
00062                 
00063                 void testRead(int returnCode) throw(RGMAException, RemoteException);
00064 
00065             public:
00066                 virtual ~SSLSocket();
00067                 SSLSocket();
00068                 void connect(std::string host, int port) throw(RGMAException, RemoteException);
00069                 void write(std::string request, std::string& resonse) throw(RGMAException, RemoteException);
00070                 virtual void close()throw(RGMAException, RemoteException);
00071         };
00072     }
00073 }
00074 #endif

Generated on Fri Mar 16 14:00:16 2007 for glite-rgma-api-cpp by doxygen 1.3.5