Kea  1.9.9-git
botan_tls.cc
Go to the documentation of this file.
1 // Copyright (C) 2021 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
8 
9 #include <config.h>
10 
11 #if defined(WITH_BOTAN) && !defined(WITH_BOTAN_BOOST)
12 
13 #include <asiolink/asio_wrapper.h>
14 #include <asiolink/crypto_tls.h>
15 
16 namespace isc {
17 namespace asiolink {
18 
19 TlsContext::TlsContext(TlsRole role)
20  : TlsContextBase(role), cert_required_(true) {
21 }
22 
23 void
24 TlsContext::setCertRequired(bool cert_required) {
25  if (!cert_required && (getRole() == TlsRole::CLIENT)) {
26  isc_throw(BadValue,
27  "'cert-required' parameter must be true for a TLS client");
28  }
29  cert_required_ = cert_required;
30 }
31 
32 bool
33 TlsContext::getCertRequired() const {
34  return (cert_required_);
35 }
36 
37 void
38 TlsContext::loadCaFile(const std::string&) {
39  isc_throw(NotImplemented, "Botan TLS is not yet supported");
40 }
41 
42 void
43 TlsContext::loadCaPath(const std::string&) {
44  isc_throw(NotImplemented, "loadCaPath is not implemented by Botan");
45 }
46 
47 void
48 TlsContext::loadCertFile(const std::string&) {
49  isc_throw(NotImplemented, "Botan TLS is not yet supported");
50 }
51 
52 void
53 TlsContext::loadKeyFile(const std::string&) {
54  isc_throw(NotImplemented, "Botan TLS is not yet supported");
55 }
56 
57 } // namespace asiolink
58 } // namespace isc
59 
60 #endif // WITH_BOTAN && !WITH_BOTAN_BOOST
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Defines the logger used by the top-level component of kea-dhcp-ddns.
TLS API.