42 trust_anchor_(
""), cert_file_(
""), key_file_(
""), cert_required_(true) {
44 isc_throw(DhcpConfigError,
"expected map type ("
45 << config->getPosition() <<
")");
52 "invalid type specified for parameter 'socket-type' ("
53 << socket_type->getPosition() <<
")");
55 socket_type_ = socket_type->stringValue();
56 if ((socket_type_ !=
"http") && (socket_type_ !=
"https")) {
58 << socket_type_ <<
"' not 'http' or 'https'");
62 if (
config->contains(
"socket-name")) {
63 isc_throw(DhcpConfigError,
64 "parameter 'socket-name' is not supported by "
65 << (socket_type_ == string(
"http") ? string(
"HTTP") : string(
"HTTPS"))
66 <<
" control sockets");
73 "invalid type specified for parameter 'socket-address' ("
74 << socket_address->getPosition() <<
")");
77 socket_address_ =
IOAddress(socket_address->stringValue());
78 }
catch (
const std::exception& ex) {
80 << socket_address->stringValue()
81 <<
"' to address: " << ex.what()
82 <<
" (" << socket_address->getPosition() <<
")");
91 "invalid type specified for parameter 'socket-port' ("
92 << socket_port->getPosition() <<
")");
94 int64_t value = socket_port->intValue();
95 if ((value < numeric_limits<uint16_t>::min()) ||
96 (value > numeric_limits<uint16_t>::max())) {
98 "out of range value " << value
99 <<
" specified for parameter 'socket-port' ("
100 << socket_port->getPosition() <<
")");
102 socket_port_ =
static_cast<uint16_t
>(value);
115 boost::const_pointer_cast<Element>(auth_config);
118 "invalid type specified for parameter 'authentication' ("
119 << auth_config->getPosition() <<
")");
129 mutable_auth_config->set(
"realm",
134 auth->parse(auth_config);
143 "invalid type specified for parameter 'trust-anchor' ("
144 << trust_anchor->getPosition() <<
")");
146 trust_anchor_ = trust_anchor->stringValue();
154 "invalid type specified for parameter 'cert-file' ("
155 << cert_file->getPosition() <<
")");
157 cert_file_ = cert_file->stringValue();
165 "invalid type specified for parameter 'key-file' ("
166 << key_file->getPosition() <<
")");
168 key_file_ = key_file->stringValue();
176 "invalid type specified for parameter 'cert-required' ("
177 << cert_required->getPosition() <<
")");
179 cert_required_ = cert_required->boolValue();
183 bool has_tls = checkTlsSetup(socket_type_ ==
"https");
184 if (!auth_config_ && !has_tls) {
187 <<
config->getPosition() <<
")");
191 std::ostringstream oss;
void contextToElement(data::ElementPtr map) const
Merge unparse a user_context object.
void setContext(const data::ConstElementPtr &ctx)
Sets user context.