66 lines
1.3 KiB
C++
66 lines
1.3 KiB
C++
#ifndef TLSServerSocket_h__
|
|
#define TLSServerSocket_h__
|
|
|
|
#include "Socket.h"
|
|
#include "TCPServer.h"
|
|
#include "Command.h"
|
|
#include "TCPSession.h"
|
|
#include "IPAddress.h"
|
|
|
|
namespace core {
|
|
|
|
///
|
|
/// TLS
|
|
///
|
|
/// This object provides the support methods to handle TLS on the server core and
|
|
/// session environment.
|
|
///
|
|
|
|
class TLS {
|
|
|
|
public:
|
|
|
|
TLS();
|
|
|
|
///
|
|
/// The destructor for this object.
|
|
///
|
|
|
|
~TLS();
|
|
|
|
SSL_CTX *ctx;
|
|
|
|
private:
|
|
|
|
char *sip_cacert = (char *)"../testkeys/certs/pbxca.crt";
|
|
char *sip_cert = (char *)"../testkeys/certs/pbxserver.crt";
|
|
char *sip_key = (char *)"../testkeys/certs/pbxserver.key";
|
|
|
|
|
|
public:
|
|
|
|
///
|
|
/// The output method is called by a socket session (Session) and
|
|
/// will output the detail information for the client socket. When extending
|
|
/// TLSSocket or Session you can override the method to add attributes
|
|
/// to the list.
|
|
///
|
|
|
|
virtual void output(std::stringstream &out);
|
|
virtual void protocol(coreutils::ZString &data) override;
|
|
|
|
protected:
|
|
void receiveData(coreutils::ZString &buffer) override;
|
|
void onRegister();
|
|
void onRegistered();
|
|
|
|
private:
|
|
bool initialized = false;
|
|
SSL *ssl;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|