smf
smf copied to clipboard
add mutual auth TLS
- Does
smfsupport secure communication (SSL/TLS) between client and server? - Any plan to add support for authentication mechanism (Mutual SSL/OAuth)?
Hiii
So sorry didn't see this before.
Yes. It will support mutual auth SSL.
If it's a priority for you I can add it next weekend.
(My equipment got robbed 2 weeks ago) :(
In fact u might even contribute it if you want. Pretty straight forward.
Have u tried it without SSL ?
Also, please submit user questions to the mailing list next.
hi @rohitjoshi - not sure if you saw my answer
so I looked into it.
it should be pretty easy to add it to both server and client.
I just need to write a test for ti.
SEASTAR_TEST_CASE(test_simple_x509_client) {
auto certs = ::make_shared<tls::certificate_credentials>();
return certs->set_x509_trust_file("tests/tls-ca-bundle.pem", tls::x509_crt_format::PEM).then([certs]() {
return connect_to_ssl_google(certs);
});
}
SEASTAR_TEST_CASE(test_x509_client_with_system_trust) {
auto certs = ::make_shared<tls::certificate_credentials>();
return certs->set_system_trust().then([certs]() {
return connect_to_ssl_google(certs);
});
}
SEASTAR_TEST_CASE(test_x509_client_with_builder_system_trust) {
tls::credentials_builder b;
b.set_system_trust();
return connect_to_ssl_google(b.build_certificate_credentials());
}
SEASTAR_TEST_CASE(test_x509_client_with_builder_system_trust_multiple) {
tls::credentials_builder b;
b.set_system_trust();
auto creds = b.build_certificate_credentials();
return parallel_for_each(boost::irange(0, 20), [creds](auto i) { return connect_to_ssl_google(creds); });
}
SEASTAR_TEST_CASE(test_x509_client_with_priority_strings) {
static std::vector<sstring> prios( { "NONE:+VERS-TLS-ALL:+MAC-ALL:+RSA:+AES-128-CBC:+SIGN-ALL:+COMP-NULL",
"NORMAL:+ARCFOUR-128", // means normal ciphers plus ARCFOUR-128.
"SECURE128:-VERS-SSL3.0:+COMP-DEFLATE", // means that only secure ciphers are enabled, SSL3.0 is disabled, and libz compression enabled.
"NONE:+VERS-TLS-ALL:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL:+SIGN-RSA-SHA1",
"NONE:+VERS-TLS-ALL:+AES-128-CBC:+ECDHE-RSA:+SHA1:+COMP-NULL:+SIGN-RSA-SHA1:+CURVE-SECP256R1",
"SECURE256:+SECURE128",
"NORMAL:%COMPAT",
"NORMAL:-MD5",
"NONE:+VERS-TLS-ALL:+MAC-ALL:+RSA:+AES-128-CBC:+SIGN-ALL:+COMP-NULL",
"NORMAL:+ARCFOUR-128",
"SECURE128:-VERS-TLS1.0:+COMP-DEFLATE",
"SECURE128:+SECURE192:-VERS-TLS-ALL:+VERS-TLS1.2"
});
return do_for_each(prios, [](const sstring & prio) {
tls::credentials_builder b;
b.set_system_trust();
b.set_priority_string(prio);
return connect_to_ssl_google(b.build_certificate_credentials());
});
}
SEASTAR_TEST_CASE(test_x509_client_with_priority_strings_fail) {
static std::vector<sstring> prios( { "NONE",
"NONE:+CURVE-SECP256R1"
});
return do_for_each(prios, [](const sstring & prio) {
tls::credentials_builder b;
b.set_system_trust();
b.set_priority_string(prio);
return connect_to_ssl_google(b.build_certificate_credentials()).then([] {
BOOST_FAIL("Expected exception");
}).handle_exception([](auto ep) {
// ok.
});
});
}