diff --git a/include/ircd/net/listener.h b/include/ircd/net/listener.h index bcc472764..181e7096a 100644 --- a/include/ircd/net/listener.h +++ b/include/ircd/net/listener.h @@ -20,6 +20,8 @@ namespace ircd::net std::ostream &operator<<(std::ostream &s, const acceptor &); extern conf::item listen; + + std::string cipher_list(const acceptor &); } struct ircd::net::listener diff --git a/ircd/net.cc b/ircd/net.cc index c21ea8476..4b7353fde 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -945,6 +945,13 @@ ircd::net::listen // listener // +std::string +ircd::net::cipher_list(const acceptor &a) +{ + auto &ssl(const_cast(a).ssl); + return openssl::cipher_list(*ssl.native_handle()); +} + std::ostream & ircd::net::operator<<(std::ostream &s, const listener &a) { diff --git a/modules/console.cc b/modules/console.cc index bb231ac5c..272c5f8ae 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -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; + + static mods::import 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) {