Kea
2.7.6
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
a
b
c
d
e
f
h
i
k
m
n
o
p
r
s
t
u
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Typedefs
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
v
w
y
Enumerations
a
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
y
Related Symbols
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Functions
a
b
c
d
e
g
h
i
l
m
n
p
q
r
s
u
v
w
y
Variables
b
c
d
e
f
h
l
n
o
p
q
r
s
t
u
y
Typedefs
Enumerations
Enumerator
d
s
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
y
▼
Kea
►
Kea Developer's Guide
►
Kea Bootp Hooks Library
►
Kea Flexible Option Hooks Library
►
Kea PerfMon Hooks Library
►
libkea-d2srv - Kea D2 Server Library
►
libkea-kea_tcp - TCP Listener Library
Todo List
►
Topics
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
src
►
bin
►
hooks
▼
lib
►
asiodns
▼
asiolink
►
addr_utilities.cc
►
addr_utilities.h
►
asio_wrapper.h
asiolink.h
botan_tls.cc
botan_tls.h
botan_wrapper.h
common_tls.cc
►
common_tls.h
crypto_tls.h
►
dummy_io_cb.h
►
interval_timer.cc
►
interval_timer.h
►
io_acceptor.h
►
io_address.cc
►
io_address.h
►
io_asio_socket.h
►
io_endpoint.cc
►
io_endpoint.h
►
io_error.h
►
io_service.cc
►
io_service.h
io_service_mgr.cc
►
io_service_mgr.h
►
io_service_signal.cc
►
io_service_signal.h
io_service_thread_pool.cc
►
io_service_thread_pool.h
►
io_socket.cc
►
io_socket.h
openssl_tls.cc
openssl_tls.h
►
process_spawn.cc
►
process_spawn.h
►
tcp_acceptor.h
►
tcp_endpoint.h
►
tcp_socket.h
►
tls_acceptor.h
►
tls_socket.h
►
udp_endpoint.h
►
udp_socket.h
►
unix_domain_socket.cc
►
unix_domain_socket.h
►
unix_domain_socket_acceptor.h
►
unix_domain_socket_endpoint.h
►
cc
►
config
►
config_backend
►
cryptolink
►
d2srv
►
database
►
dhcp
►
dhcp_ddns
►
dhcpsrv
►
dns
►
eval
►
exceptions
►
hooks
►
http
►
log
►
mysql
►
pgsql
►
process
►
stats
►
tcp
►
testutils
►
util
►
yang
►
File Members
common_tls.cc
Go to the documentation of this file.
1
// Copyright (C) 2021-2024 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
#include <
asiolink/asio_wrapper.h
>
12
#include <
asiolink/crypto_tls.h
>
13
#include <
util/filesystem.h
>
14
15
using namespace
isc::cryptolink
;
16
using namespace
isc::util
;
17
18
namespace
isc
{
19
namespace
asiolink
{
20
21
void
22
TlsContextBase::configure
(
TlsContextPtr
& context,
23
TlsRole
role,
24
const
std::string& ca_file,
25
const
std::string& cert_file,
26
const
std::string& key_file,
27
bool
cert_required) {
28
try
{
29
context.reset(
new
TlsContext(role));
30
context->setCertRequired(cert_required);
31
if
(
file::isDir
(ca_file)) {
32
try
{
33
context->loadCaPath(ca_file);
34
}
catch
(
const
std::exception& ex) {
35
isc_throw
(
isc::BadValue
,
"load of CA directory '"
36
<< ca_file <<
"' failed: "
<< ex.what());
37
}
38
}
else
{
39
try
{
40
context->loadCaFile(ca_file);
41
}
catch
(
const
std::exception& ex) {
42
isc_throw
(
isc::BadValue
,
"load of CA file '"
43
<< ca_file <<
"' failed: "
<< ex.what());
44
}
45
}
46
try
{
47
context->loadCertFile(cert_file);
48
}
catch
(
const
std::exception& ex) {
49
isc_throw
(
isc::BadValue
,
"load of cert file '"
50
<< cert_file <<
"' failed: "
<< ex.what());
51
}
52
try
{
53
context->loadKeyFile(key_file);
54
}
catch
(
const
std::exception& ex) {
55
isc_throw
(
isc::BadValue
,
"load of private key file '"
56
<< key_file <<
"' failed: "
<< ex.what());
57
}
58
}
catch
(...) {
59
context.reset();
60
throw
;
61
}
62
}
22
TlsContextBase::configure
(
TlsContextPtr
& context, {
…
}
63
64
}
// namespace asiolink
65
}
// namespace isc
asio_wrapper.h
isc::BadValue
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Definition
exceptions/exceptions.h:132
isc::asiolink::TlsContextBase::configure
static void configure(TlsContextPtr &context, TlsRole role, const std::string &ca_file, const std::string &cert_file, const std::string &key_file, bool cert_required=true)
Configure.
Definition
common_tls.cc:22
crypto_tls.h
TLS API.
isc_throw
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Definition
exceptions/exceptions.h:210
filesystem.h
asiolink
A wrapper interface for the ASIO library.
isc::asiolink::TlsContextPtr
boost::shared_ptr< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
Definition
common_tls.h:37
isc::asiolink::TlsRole
TlsRole
Client and server roles.
Definition
common_tls.h:31
isc::cryptolink
Definition
botan_common.h:8
isc::util::file::isDir
bool isDir(string const &path)
Check if there is a directory at the given path.
Definition
filesystem.cc:52
isc::util
Definition
time_utils.cc:43
isc
Defines the logger used by the top-level component of kea-lfc.
Definition
agent_parser.cc:148
src
lib
asiolink
common_tls.cc
Generated on Tue Dec 24 2024 13:23:54 for Kea by
1.12.0