# HG changeset patch # User David Demelier # Date 1542283630 -3600 # Node ID 5a421b20a4f4b5277ab856bb8d1feee779c6583b # Parent 75aca6bc1cd73b0398f63b24b4f17341ab17cc36 misc: remove ssl verification for now, closes #953 @30m diff -r 75aca6bc1cd7 -r 5a421b20a4f4 MIGRATING.md --- a/MIGRATING.md Wed Nov 14 20:16:00 2018 +0100 +++ b/MIGRATING.md Thu Nov 15 13:07:10 2018 +0100 @@ -20,7 +20,8 @@ `server-notice` and `server-mode` instead, - The option `connect.host` has been renamed to `connect.hostname`, - The option `--host` has been renamed to `--hostname`, -- The output style has been unified. +- The output style has been unified, +- Options `-S` and `--ssl-verify` in server-connect have been removed. ### Plugins @@ -71,7 +72,8 @@ - The object returned in the method `Server.info` now has a `hostname` property instead of `host`. - The property `host` in constructor `Server` has been renamed to - `hostname`. + `hostname`, +- The property `sslVerify` in `Server` constructor has been removed. #### Module ElapsedTimer diff -r 75aca6bc1cd7 -r 5a421b20a4f4 irccdctl/cli.cpp --- a/irccdctl/cli.cpp Wed Nov 14 20:16:00 2018 +0100 +++ b/irccdctl/cli.cpp Thu Nov 15 13:07:10 2018 +0100 @@ -239,8 +239,6 @@ { "--nickname", true }, { "-r", true }, { "--realname", true }, - { "-S", false }, - { "--ssl-verify", false }, { "-s", false }, { "--ssl", false }, { "-u", true }, @@ -808,8 +806,6 @@ object["port"] = *port; } - if (result.count("-S") > 0 || result.count("--ssl-verify") > 0) - object["sslVerify"] = true; if (result.count("-s") > 0 || result.count("--ssl") > 0) object["ssl"] = true; if ((it = result.find("-n")) != result.end() || (it = result.find("--nickname")) != result.end()) diff -r 75aca6bc1cd7 -r 5a421b20a4f4 libirccd-js/irccd/js/server_js_api.cpp --- a/libirccd-js/irccd/js/server_js_api.cpp Wed Nov 14 20:16:00 2018 +0100 +++ b/libirccd-js/irccd/js/server_js_api.cpp Thu Nov 15 13:07:10 2018 +0100 @@ -91,12 +91,8 @@ duk_put_prop_string(ctx, -2, "hostname"); duk_push_int(ctx, server->get_port()); duk_put_prop_string(ctx, -2, "port"); - duk_push_boolean(ctx, - (server->get_options() & server::options::ssl) == server::options::ssl); + duk_push_boolean(ctx, (server->get_options() & server::options::ssl) == server::options::ssl); duk_put_prop_string(ctx, -2, "ssl"); - duk_push_boolean(ctx, - (server->get_options() & server::options::ssl_verify) == server::options::ssl_verify); - duk_put_prop_string(ctx, -2, "sslVerify"); duk::push(ctx, server->get_command_char()); duk_put_prop_string(ctx, -2, "commandChar"); duk::push(ctx, server->get_realname()); @@ -601,7 +597,6 @@ * password: the password, (Optional: default none) * channels: array of channels (Optiona: default empty) * ssl: true to use ssl, (Optional: default false) - * sslVerify: true to verify (Optional: default true) * nickname: "nickname", (Optional, default: irccd) * username: "user name", (Optional, default: irccd) * realname: "real name", (Optional, default: IRC Client Daemon) diff -r 75aca6bc1cd7 -r 5a421b20a4f4 libirccd/irccd/daemon/server.hpp --- a/libirccd/irccd/daemon/server.hpp Wed Nov 14 20:16:00 2018 +0100 +++ b/libirccd/irccd/daemon/server.hpp Thu Nov 15 13:07:10 2018 +0100 @@ -284,10 +284,9 @@ ipv4 = (1 << 0), //!< Connect using IPv4 ipv6 = (1 << 1), //!< Connect using IPv6 ssl = (1 << 2), //!< Use SSL - ssl_verify = (1 << 3), //!< Verify SSL - auto_rejoin = (1 << 4), //!< Auto rejoin a kick - auto_reconnect = (1 << 5), //!< Auto reconnect on disconnection - join_invite = (1 << 6) //!< Join a channel on invitation + auto_rejoin = (1 << 3), //!< Auto rejoin a kick + auto_reconnect = (1 << 4), //!< Auto reconnect on disconnection + join_invite = (1 << 5) //!< Join a channel on invitation }; /** diff -r 75aca6bc1cd7 -r 5a421b20a4f4 libirccd/irccd/daemon/server_util.cpp --- a/libirccd/irccd/daemon/server_util.cpp Wed Nov 14 20:16:00 2018 +0100 +++ b/libirccd/irccd/daemon/server_util.cpp Thu Nov 15 13:07:10 2018 +0100 @@ -80,7 +80,6 @@ void from_config_load_flags(server& sv, const ini::section& sc) { const auto ssl = sc.find("ssl"); - const auto ssl_verify = sc.find("ssl-verify"); const auto auto_rejoin = sc.find("auto-rejoin"); const auto auto_reconnect = sc.find("auto-reconnect"); const auto join_invite = sc.find("join-invite"); @@ -89,8 +88,6 @@ if (ssl != sc.end()) toggle(sv, server::options::ssl, string_util::is_boolean(ssl->get_value())); - if (ssl_verify != sc.end()) - toggle(sv, server::options::ssl_verify, string_util::is_boolean(ssl_verify->get_value())); if (auto_rejoin != sc.end()) toggle(sv, server::options::auto_rejoin, string_util::is_boolean(auto_rejoin->get_value())); if (auto_reconnect != sc.end()) @@ -173,7 +170,6 @@ const auto auto_rejoin = parser.get("autoRejoin"); const auto join_invite = parser.get("joinInvite"); const auto ssl = parser.get("ssl"); - const auto ssl_verify = parser.get("sslVerify"); const auto ipv4 = parser.optional("ipv4", true); const auto ipv6 = parser.optional("ipv6", true); @@ -182,20 +178,14 @@ toggle(sv, server::options::ipv4, *ipv4); toggle(sv, server::options::ipv6, *ipv6); - - if (auto_rejoin.value_or(false)) - sv.set_options(sv.get_options() | server::options::auto_rejoin); - if (join_invite.value_or(false)) - sv.set_options(sv.get_options() | server::options::join_invite); + toggle(sv, server::options::auto_rejoin, *auto_rejoin); + toggle(sv, server::options::join_invite, *join_invite); + toggle(sv, server::options::ssl, *ssl); - if (ssl.value_or(false)) #if !defined(IRCCD_HAVE_SSL) + if ((server::get_options() & server::options::ssl) == server::options::ssl) throw server_error(server_error::ssl_disabled); -#else - sv.set_options(sv.get_options() | server::options::ssl); #endif - if (ssl_verify.value_or(false)) - sv.set_options(sv.get_options() | server::options::ssl_verify); // Verify that at least IPv4 or IPv6 is set. if ((sv.get_options() & server::options::ipv4) != server::options::ipv4 && diff -r 75aca6bc1cd7 -r 5a421b20a4f4 tests/src/libirccd/command-server-connect/main.cpp --- a/tests/src/libirccd/command-server-connect/main.cpp Wed Nov 14 20:16:00 2018 +0100 +++ b/tests/src/libirccd/command-server-connect/main.cpp Thu Nov 15 13:07:10 2018 +0100 @@ -85,7 +85,6 @@ BOOST_TEST(!static_cast(s->get_options() & server::options::ipv4)); BOOST_TEST(static_cast(s->get_options() & server::options::ipv6)); BOOST_TEST(static_cast(s->get_options() & server::options::ssl)); - BOOST_TEST(static_cast(s->get_options() & server::options::ssl_verify)); BOOST_TEST(static_cast(s->get_options() & server::options::auto_rejoin)); BOOST_TEST(static_cast(s->get_options() & server::options::join_invite)); }