Beginning of TLS workings.
This commit is contained in:
1 parent
b2bdb522b3
commit
519faa535b
2 files changed
+239
No files matched your search
@@ -0,0 +1,65 @@
|
||||
#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
|
||||
Reference in new issue
Block a user