From 885f18ec0f83d753958bbe3c7634800dccaa55ed Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 23 Oct 2017 16:28:48 +0900 Subject: [PATCH 1/2] Added comments. --- include/mqtt/client.hpp | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/include/mqtt/client.hpp b/include/mqtt/client.hpp index f88636d6a..6c438dfbb 100644 --- a/include/mqtt/client.hpp +++ b/include/mqtt/client.hpp @@ -149,28 +149,76 @@ class client : public endpoint { make_tls_client_no_strand_ws(as::io_service& ios, std::string host, std::string port, std::string path); #endif // defined(MQTT_USE_WS) + /** + * @breif Call boost::asio::context::set_default_verify_paths + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/set_default_verify_paths.html + */ void set_default_verify_paths() { ctx_.set_default_verify_paths(); } + /** + * @breif Call boost::asio::context::load_verify_file + * The function name is not the same but easy to understand. + * @param file ca cert file path + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/load_verify_file.html + */ void set_ca_cert_file(std::string file) { ctx_.load_verify_file(std::move(file)); } + + /** + * @breif Call boost::asio::context::add_verify_path + * @param path the path contains ca cert files + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/add_verify_path.html + */ void add_verify_path(std::string path) { ctx_.add_verify_path(path); } + + /** + * @breif Call boost::asio::context::set_verify_depth + * @param depth maximum depth for the certificate chain verificatrion that shall be allowed + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/set_verify_depth.html + */ void set_verify_depth(int depth) { ctx_.set_verify_depth(depth); } + + /** + * @breif Call boost::asio::context::use_certificate_file + * The function name is not the same but easy to understand. + * @param file client certificate file path + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/load_verify_file.html + */ void set_client_cert_file(std::string file) { ctx_.use_certificate_file(std::move(file), as::ssl::context::pem); } + + /** + * @breif Call boost::asio::context::use_private_key_file + * The function name is not the same but easy to understand. + * @param file client certificate key file path + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/use_private_key_file.html + */ void set_client_key_file(std::string file) { ctx_.use_private_key_file(std::move(file), as::ssl::context::pem); } + + /** + * @breif Call boost::asio::context::set_verify_mode + * @param mode See http://www.boost.org/doc/html/boost_asio/reference/ssl__verify_mode.html + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/set_verify_mode.html + */ void set_verify_mode(as::ssl::verify_mode mode) { ctx_.set_verify_mode(mode); } + + /** + * @breif Call boost::asio::context::set_verify_callback + * @param callback the callback function to be used for verifying a certificate. + * See http://www.boost.org/doc/html/boost_asio/reference/ssl__context/set_verify_callback.html + */ template void set_verify_callback(VerifyCallback&& callback) { ctx_.set_verify_callback(std::forward(callback)); From d19fcace0182af5c4287544afaf376afd8932b07 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 23 Oct 2017 16:28:59 +0900 Subject: [PATCH 2/2] Updated the version to 1.0.8. --- CHANGELOG.md | 3 +++ README.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f246fdff..d75b15f2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.0.8 +* Added TLS verifying setup functions. (#100) + ## 1.0.7 * Update beast. (#94) * Fixed WebSocket strand management. (#93, #95) diff --git a/README.md b/README.md index 84f8da98f..d8e35ed60 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MQTT client/server for C++14 based on Boost.Asio -Version 1.0.7 [![Build Status](https://travis-ci.org/redboltz/mqtt_cpp.svg?branch=master)](https://travis-ci.org/redboltz/mqtt_cpp) [![Build status](https://ci.appveyor.com/api/projects/status/21a267hd34s0kqu5/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/mqtt-client-cpp/branch/master) +Version 1.0.8 [![Build Status](https://travis-ci.org/redboltz/mqtt_cpp.svg?branch=master)](https://travis-ci.org/redboltz/mqtt_cpp) [![Build status](https://ci.appveyor.com/api/projects/status/21a267hd34s0kqu5/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/mqtt-client-cpp/branch/master) ## Overview