mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 16:34:13 +01:00
ircd::net: Add interface to get cipher list from acceptor w/ console cmd.
This commit is contained in:
parent
8daddfb84a
commit
213c46d9f8
3 changed files with 44 additions and 0 deletions
|
@ -20,6 +20,8 @@ namespace ircd::net
|
|||
std::ostream &operator<<(std::ostream &s, const acceptor &);
|
||||
|
||||
extern conf::item<bool> listen;
|
||||
|
||||
std::string cipher_list(const acceptor &);
|
||||
}
|
||||
|
||||
struct ircd::net::listener
|
||||
|
|
|
@ -945,6 +945,13 @@ ircd::net::listen
|
|||
// listener
|
||||
//
|
||||
|
||||
std::string
|
||||
ircd::net::cipher_list(const acceptor &a)
|
||||
{
|
||||
auto &ssl(const_cast<acceptor &>(a).ssl);
|
||||
return openssl::cipher_list(*ssl.native_handle());
|
||||
}
|
||||
|
||||
std::ostream &
|
||||
ircd::net::operator<<(std::ostream &s, const listener &a)
|
||||
{
|
||||
|
|
|
@ -4430,6 +4430,41 @@ console_cmd__net__listen__list(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__net__listen__ciphers(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"name",
|
||||
}};
|
||||
|
||||
const auto &name
|
||||
{
|
||||
param["name"]
|
||||
};
|
||||
|
||||
using list = std::list<net::listener>;
|
||||
|
||||
static mods::import<list> listeners
|
||||
{
|
||||
"s_listen", "listeners"
|
||||
};
|
||||
|
||||
const list &l(listeners);
|
||||
for(const auto &listener : l)
|
||||
{
|
||||
if(name && listener.name() != name)
|
||||
continue;
|
||||
|
||||
out << listener.name() << ": " << std::endl
|
||||
<< cipher_list(listener)
|
||||
<< std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__net__listen(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue