mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
SNI: create SNI namespace and rename SNIHandlerBase -> SNI::HandlerBase
Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
parent
4bd5869305
commit
001b731fe2
@ -248,7 +248,7 @@ namespace openvpn {
|
||||
throw MbedTLSException("set_client_session_tickets not implemented");
|
||||
}
|
||||
|
||||
virtual void set_sni_handler(SNIHandlerBase* sni_handler)
|
||||
virtual void set_sni_handler(SNI::HandlerBase* sni_handler)
|
||||
{
|
||||
// fixme -- this method should be implemented on the server-side for SNI
|
||||
throw MbedTLSException("set_sni_handler not implemented");
|
||||
|
@ -132,7 +132,7 @@ namespace openvpn {
|
||||
}
|
||||
|
||||
// server side
|
||||
virtual void set_sni_handler(SNIHandlerBase* sni_handler_arg)
|
||||
virtual void set_sni_handler(SNI::HandlerBase* sni_handler_arg)
|
||||
{
|
||||
sni_handler = sni_handler_arg;
|
||||
}
|
||||
@ -525,7 +525,7 @@ namespace openvpn {
|
||||
OpenSSLPKI::DH dh; // diffie-hellman parameters (only needed in server mode)
|
||||
ExternalPKIBase* external_pki = nullptr;
|
||||
TLSSessionTicketBase* session_ticket_handler = nullptr; // server side only
|
||||
SNIHandlerBase* sni_handler = nullptr; // server side only
|
||||
SNI::HandlerBase* sni_handler = nullptr; // server side only
|
||||
Frame::Ptr frame;
|
||||
int ssl_debug_level = 0;
|
||||
unsigned int flags = 0; // defined in sslconsts.hpp
|
||||
|
@ -27,19 +27,20 @@
|
||||
#include <openvpn/ssl/sslapi.hpp>
|
||||
|
||||
namespace openvpn {
|
||||
namespace SNI {
|
||||
|
||||
// Abstract base class used to provide an SNI handler
|
||||
//
|
||||
class SNIHandlerBase
|
||||
{
|
||||
public:
|
||||
// Return a new SSLFactoryAPI for this SNI name.
|
||||
// Return SSLFactoryAPI::Ptr() if sni_name is not recognized.
|
||||
// The caller guarantees that sni_name is valid UTF-8 and
|
||||
// doesn't contain any control characters.
|
||||
virtual SSLFactoryAPI::Ptr sni_hello(const std::string& sni_name, SSLConfigAPI::Ptr default_factory) const = 0;
|
||||
// Abstract base class used to provide an SNI handler
|
||||
class HandlerBase
|
||||
{
|
||||
public:
|
||||
// Return a new SSLFactoryAPI for this SNI name.
|
||||
// Return SSLFactoryAPI::Ptr() if sni_name is not recognized.
|
||||
// The caller guarantees that sni_name is valid UTF-8 and
|
||||
// doesn't contain any control characters.
|
||||
virtual SSLFactoryAPI::Ptr sni_hello(const std::string& sni_name, SSLConfigAPI::Ptr default_factory) const = 0;
|
||||
|
||||
virtual ~SNIHandlerBase() {}
|
||||
};
|
||||
virtual ~HandlerBase() {}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,9 @@
|
||||
|
||||
namespace openvpn {
|
||||
|
||||
class SNIHandlerBase;
|
||||
namespace SNI {
|
||||
class HandlerBase;
|
||||
}
|
||||
|
||||
class SSLAPI : public RC<thread_unsafe_refcount>
|
||||
{
|
||||
@ -141,7 +143,7 @@ namespace openvpn {
|
||||
virtual void set_external_pki_callback(ExternalPKIBase* external_pki_arg) = 0; // private key alternative
|
||||
virtual void set_session_ticket_handler(TLSSessionTicketBase* session_ticket_handler) = 0; // server side
|
||||
virtual void set_client_session_tickets(const bool v) = 0; // client side
|
||||
virtual void set_sni_handler(SNIHandlerBase* sni_handler) = 0; // server side
|
||||
virtual void set_sni_handler(SNI::HandlerBase* sni_handler) = 0; // server side
|
||||
virtual void set_private_key_password(const std::string& pwd) = 0;
|
||||
virtual void load_ca(const std::string& ca_txt, bool strict) = 0;
|
||||
virtual void load_crl(const std::string& crl_txt) = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user