1234567891011121314151617181920212223 |
- #pragma once
- #ifdef USE_MITM
- #include "IBBS2chProxySocket.h"
- #include <openssl/ssl.h>
- class BBS2chProxySecureSocket : public IBBS2chProxySocket {
- public:
- BBS2chProxySecureSocket(int sock, const char *host);
- ~BBS2chProxySecureSocket();
- static int initializeCerts(const char *certPath, const char *keyPath);
- static void generateAndPrintSelfSignedCertificate(void);
- virtual int read(char *buffer, int length);
- virtual int readLine(char *buffer, int maxLength);
- virtual int write(const char *buffer, int length);
- virtual int writeString(const std::string &str);
- virtual void close(void);
- private:
- int socket;
- SSL_CTX *ctx;
- SSL *ssl;
- };
- #endif
|