emables tls
@@ -17,8 +17,12 @@ namespace SimpleWeb {
public:
Client(const std::string &server_port_path, bool verify_certificate = true, const std::string &cert_file = std::string(),
const std::string &private_key_file = std::string(), const std::string &verify_file = std::string())
- : ClientBase<HTTPS>::ClientBase(server_port_path, 443), context(asio::ssl::context::tlsv1) {
- // NB Set tlsv1 rather than tlsv12 for compatibility with PI Connector Relay
+ : ClientBase<HTTPS>::ClientBase(server_port_path, 443), context(asio::ssl::context::tls) {
+
+ // Disables old protocols
+ context.set_options(boost::asio::ssl::context::no_sslv2);
+ context.set_options(boost::asio::ssl::context::no_sslv3);
+
if(cert_file.size() > 0 && private_key_file.size() > 0) {
context.use_certificate_chain_file(cert_file);
context.use_private_key_file(private_key_file, asio::ssl::context::pem);
