Files
ylib/include/ynet/http_ssl.h
2024-03-31 21:45:09 +08:00

47 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include "http_define.h"
#if USE_NET_HTTP_WEBSITE
#include <functional>
#include "http_interface.h"
#include <map>
namespace ylib::network::http
{
class server;
/******************************************************
* class域名器
******************************************************/
class ssl :public ylib::error_base, public network::http::interface_
{
public:
/**********************************************************************************************
* function构造函数
* param
* server HTTP服务
* verify_type 验证方式
* pem_cert 证书内容
* pem_key 证书密钥
* pem_ca CA证书
* password 证书密码,没有留空
**********************************************************************************************/
ssl(network::http::server* server,ssl_verify_type verify_type,const std::string& pem_cert,const std::string&pem_key, const std::string& pem_ca = "", const std::string& password = "");
~ssl();
/**********************************************************************************************
* function注册证书
**********************************************************************************************/
bool regist();
/**********************************************************************************************
* function绑定
**********************************************************************************************/
bool bind(const std::string& host);
private:
ssl_verify_type m_verify_type;
std::string m_pem_cert;
std::string m_pem_key;
std::string m_pem_ca;
std::string m_pem_password;
network::http::server* m_server;
int32 m_index;
};
}
#endif