2020-05-09 23:31:44 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
#include "../acl_cpp_define.hpp"
|
|
|
|
|
#include "../stdlib/noncopyable.hpp"
|
|
|
|
|
|
2022-08-19 10:28:04 +08:00
|
|
|
|
namespace acl {
|
2020-05-09 23:31:44 +08:00
|
|
|
|
|
|
|
|
|
class sslbase_io;
|
|
|
|
|
|
2022-08-19 10:28:04 +08:00
|
|
|
|
class ACL_CPP_API sslbase_conf : public noncopyable {
|
2020-05-09 23:31:44 +08:00
|
|
|
|
public:
|
|
|
|
|
sslbase_conf(void) {}
|
|
|
|
|
virtual ~sslbase_conf(void) {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>鷽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SSL IO <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param nblock {bool} <EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
|
|
|
|
|
* @return {sslbase_io*}
|
|
|
|
|
*/
|
2020-07-01 17:05:41 +08:00
|
|
|
|
virtual sslbase_io* create(bool nblock) = 0;
|
2020-05-09 23:31:44 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> CA <EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>(ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>α<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* @param ca_file {const char*} CA ֤<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ȫ·<EFBFBD><EFBFBD>
|
|
|
|
|
* @param ca_path {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> CA ֤<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> CA <EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
|
|
|
|
* ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ca_file<EFBFBD><EFBFBD>ca_path <EFBFBD><EFBFBD><EFBFBD>ǿգ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>μ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
virtual bool load_ca(const char* ca_file, const char* ca_path)
|
|
|
|
|
{
|
|
|
|
|
(void) ca_file;
|
|
|
|
|
(void) ca_path;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-06 21:26:30 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>飬<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD>ε<EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>
|
|
|
|
|
* @param crt_file {const char*} ֤<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ȫ·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param key_file {const char*} <EFBFBD><EFBFBD>Կ<EFBFBD>ļ<EFBFBD>ȫ·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param key_pass {const char*} <EFBFBD><EFBFBD>Կ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д NULL
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
|
|
|
|
*/
|
2022-08-20 21:32:08 +08:00
|
|
|
|
virtual bool add_cert(const char* crt_file, const char* key_file,
|
2020-09-07 21:24:39 +08:00
|
|
|
|
const char* key_pass = NULL)
|
2020-09-06 21:26:30 +08:00
|
|
|
|
{
|
|
|
|
|
(void) crt_file;
|
|
|
|
|
(void) key_file;
|
|
|
|
|
(void) key_pass;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-09 23:31:44 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>飬<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD>ε<EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>
|
|
|
|
|
* @param crt_file {const char*} ֤<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ȫ·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2022-08-21 17:34:05 +08:00
|
|
|
|
* @deprecated use add_cert(const char*, const char*, const char*)
|
2020-05-09 23:31:44 +08:00
|
|
|
|
*/
|
|
|
|
|
virtual bool add_cert(const char* crt_file)
|
|
|
|
|
{
|
|
|
|
|
(void) crt_file;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>ͻ<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>Կ(ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>α<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* @param key_file {const char*} <EFBFBD><EFBFBD>Կ<EFBFBD>ļ<EFBFBD>ȫ·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param key_pass {const char*} <EFBFBD><EFBFBD>Կ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д NULL
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2022-08-21 17:34:05 +08:00
|
|
|
|
* @deprecated use add_cert(const char*, const char*, const char*)
|
2020-05-09 23:31:44 +08:00
|
|
|
|
*/
|
|
|
|
|
virtual bool set_key(const char* key_file, const char* key_pass = NULL)
|
|
|
|
|
{
|
|
|
|
|
(void) key_file;
|
|
|
|
|
(void) key_pass;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ûỰ<EFBFBD><EFBFBD><EFBFBD>湦<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SSL <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>
|
|
|
|
|
* @param on {bool}
|
|
|
|
|
* ע<EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Է<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>Ч
|
|
|
|
|
*/
|
|
|
|
|
virtual void enable_cache(bool on)
|
|
|
|
|
{
|
|
|
|
|
(void) on;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|