BBS2chProxySecureSocket.h 652 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #ifdef USE_MITM
  3. #include "IBBS2chProxySocket.h"
  4. #include <openssl/ssl.h>
  5. class BBS2chProxySecureSocket : public IBBS2chProxySocket {
  6. public:
  7. BBS2chProxySecureSocket(int sock, const char *host);
  8. ~BBS2chProxySecureSocket();
  9. static int initializeCerts(const char *certPath, const char *keyPath);
  10. static void generateAndPrintSelfSignedCertificate(void);
  11. virtual int read(char *buffer, int length);
  12. virtual int readLine(char *buffer, int maxLength);
  13. virtual int write(const char *buffer, int length);
  14. virtual int writeString(const std::string &str);
  15. virtual void close(void);
  16. private:
  17. int socket;
  18. SSL_CTX *ctx;
  19. SSL *ssl;
  20. };
  21. #endif