22 isDir(
const std::string& name) {
24 if (::stat(name.c_str(), &stats) < 0) {
27 return ((stats.st_mode & S_IFMT) == S_IFDIR);
38 const std::string& ca_file,
39 const std::string& cert_file,
40 const std::string& key_file,
43 context.reset(
new TlsContext(role));
44 context->setCertRequired(cert_required);
47 context->loadCaPath(ca_file);
48 }
catch (
const std::exception& ex) {
50 << ca_file <<
"' failed: " << ex.
what());
54 context->loadCaFile(ca_file);
55 }
catch (
const std::exception& ex) {
57 << ca_file <<
"' failed: " << ex.
what());
61 context->loadCertFile(cert_file);
62 }
catch (
const std::exception& ex) {
64 << cert_file <<
"' failed: " << ex.
what());
67 context->loadKeyFile(key_file);
68 }
catch (
const std::exception& ex) {
70 << key_file <<
"' failed: " << ex.
what());
boost::shared_ptr< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Defines the logger used by the top-level component of kea-dhcp-ddns.
A wrapper interface for the ASIO library.
TlsRole
Client and server roles.