OpenVPN 3 Core Library
Loading...
Searching...
No Matches
sni_handler.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#pragma once
13
14#include <string>
15#include <memory>
16
19
20namespace openvpn::SNI {
21
22// Abstract base class used to provide an SNI handler
24{
25 public:
26 typedef std::unique_ptr<HandlerBase> UPtr;
27
28 // Return a new SSLFactoryAPI for this SNI name.
29 // Implementation may also set sni_metadata.
30 // Return SSLFactoryAPI::Ptr() if sni_name is not recognized.
31 // The caller guarantees that sni_name is valid UTF-8 and
32 // doesn't contain any control characters.
33
34 // clang-format off
35 virtual SSLFactoryAPI::Ptr sni_hello(const std::string &sni_name,
36 SNI::Metadata::UPtr &sni_metadata,
37 SSLConfigAPI::Ptr default_factory) const = 0;
38 // clang-format on
39
40 virtual ~HandlerBase() = default;
41};
42
43} // namespace openvpn::SNI
virtual SSLFactoryAPI::Ptr sni_hello(const std::string &sni_name, SNI::Metadata::UPtr &sni_metadata, SSLConfigAPI::Ptr default_factory) const =0
std::unique_ptr< HandlerBase > UPtr
virtual ~HandlerBase()=default
std::unique_ptr< Metadata > UPtr