This repository has been archived on 2024-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
cathook/include/https_request.hpp
2017-11-13 09:41:53 +03:00

45 lines
629 B
C++

/*
* https_request.hpp
*
* Created on: Jul 23, 2017
* Author: nullifiedcat
*/
#pragma once
#include <aftercheaders.hpp>
#include <beforecheaders.hpp>
#include <openssl/ssl.h>
#include <netinet/in.h>
#include <string>
namespace https {
extern SSL_CTX *ssl_context;
class RAII_HTTPS_Socket {
public:
RAII_HTTPS_Socket(const std::string& host);
~RAII_HTTPS_Socket();
bool ssl_connect();
void ssl_die();
std::string get(const std::string& path);
const std::string hostname_;
hostent *host_ { nullptr };
sockaddr_in addr_ {};
int sock_ { -1 };
SSL *connection_ { nullptr };
};
void initialize();
}