http_ssl.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include "http_define.h"
  3. #if USE_NET_HTTP_WEBSITE
  4. #include <functional>
  5. #include "http_interface.h"
  6. #include <map>
  7. namespace ylib
  8. {
  9. namespace network
  10. {
  11. namespace http
  12. {
  13. class server;
  14. /******************************************************
  15. * class:域名器
  16. ******************************************************/
  17. class ssl :public ylib::error_base, public network::http::interface_
  18. {
  19. public:
  20. /**********************************************************************************************
  21. * function:构造函数
  22. * param
  23. * server : HTTP服务
  24. * config : 配置
  25. **********************************************************************************************/
  26. ssl(network::http::server* server,ssl_config config);
  27. ~ssl();
  28. /**********************************************************************************************
  29. * function:注册证书
  30. **********************************************************************************************/
  31. bool regist();
  32. /**********************************************************************************************
  33. * function:绑定
  34. **********************************************************************************************/
  35. bool bind(const std::string& host);
  36. private:
  37. ssl_config m_config;
  38. std::string m_pem_cert_data;
  39. std::string m_pem_key_data;
  40. std::string m_pem_ca_data;
  41. network::http::server* m_server;
  42. int32 m_index;
  43. };
  44. }
  45. }
  46. }
  47. #endif