14#if defined(WITH_BOTAN) && !defined(WITH_BOTAN_BOOST)
27class TlsContext :
public TlsContextBase {
31 virtual ~TlsContext() { }
36 explicit TlsContext(TlsRole role);
42 virtual bool getCertRequired()
const;
49 virtual void setCertRequired(
bool cert_required);
56 virtual void loadCaFile(
const std::string& ca_file);
63 virtual void loadCaPath(
const std::string& ca_path);
70 virtual void loadCertFile(
const std::string& cert_file);
77 virtual void loadKeyFile(
const std::string& key_file);
83 friend class TlsContextBase;
87typedef boost::asio::ip::tcp::socket TlsStreamImpl;
96template <
typename Callback,
typename TlsStreamImpl>
99 : StreamService(io_service, context),
100 TlsStreamImpl(io_service->getInternalIOService()),
101 role_(context->getRole()) {
107template <
typename Callback>
108class TlsStream :
public TlsStreamBase<Callback, TlsStreamImpl> {
112 typedef TlsStreamBase<Callback, TlsStreamImpl> Base;
119 TlsStream(
const IOServicePtr& service, TlsContextPtr context)
120 : Base(service, context) {
124 virtual ~TlsStream() { }
127 virtual void handshake(Callback&) {
128 isc_throw(NotImplemented,
"Botan TLS is not yet supported");
132 virtual void shutdown(Callback&) {
133 isc_throw(NotImplemented,
"Botan TLS is not yet supported");
146 std::string getSubject() {
160 std::string getIssuer() {
TlsStreamBase(const IOServicePtr &service, TlsContextPtr context)
Constructor.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A wrapper interface for the ASIO library.
boost::shared_ptr< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
Defines the logger used by the top-level component of kea-lfc.