24 const std::string& ca_file,
25 const std::string& cert_file,
26 const std::string& key_file,
29 context.reset(
new TlsContext(role));
30 context->setCertRequired(cert_required);
33 context->loadCaPath(ca_file);
34 }
catch (
const std::exception& ex) {
36 << ca_file <<
"' failed: " << ex.
what());
40 context->loadCaFile(ca_file);
41 }
catch (
const std::exception& ex) {
43 << ca_file <<
"' failed: " << ex.
what());
47 context->loadCertFile(cert_file);
48 }
catch (
const std::exception& ex) {
50 << cert_file <<
"' failed: " << ex.
what());
53 context->loadKeyFile(key_file);
54 }
catch (
const std::exception& ex) {
56 << key_file <<
"' failed: " << ex.
what());
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
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...
bool isDir(const string &name)
Is a directory predicate.
Defines the logger used by the top-level component of kea-lfc.
A wrapper interface for the ASIO library.
TlsRole
Client and server roles.