File tree Expand file tree Collapse file tree 6 files changed +13
-17
lines changed
http/src/network/protocol/http/client/connection Expand file tree Collapse file tree 6 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -246,19 +246,18 @@ struct http_async_connection_pimpl
246
246
boost::system::error_code const & ec,
247
247
std::size_t bytes_transferred) {
248
248
NETWORK_MESSAGE (" http_async_connection_pimpl::handle_received_data(...)" );
249
+ #ifdef NETWORK_ENABLE_HTTPS
249
250
// Okay, there's some weirdness with Boost.Asio's handling of SSL errors
250
251
// so we need to do some acrobatics to make sure that we're handling the
251
252
// short-read errors correctly. This is such a PITA that we have to deal
252
253
// with this here.
253
- static long short_read_error = 335544539 ;
254
+ constexpr static long short_read_error = 335544539 ;
254
255
bool is_short_read_error =
255
- #ifdef NETWORK_ENABLE_HTTPS
256
- ec.category () == boost::asio::error::ssl_category &&
257
- ec.value () == short_read_error
256
+ (ec.category () == boost::asio::error::ssl_category) &&
257
+ (ec.value () == short_read_error);
258
258
#else
259
- false
259
+ constexpr bool is_short_read_error = false ;
260
260
#endif
261
- ;
262
261
if (!ec || ec == boost::asio::error::eof || is_short_read_error) {
263
262
NETWORK_MESSAGE (" processing data chunk, no error encountered so far..." );
264
263
boost::logic::tribool parsed_ok;
Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ struct connection_delegate_factory {
30
30
virtual ~connection_delegate_factory ();
31
31
32
32
private:
33
- connection_delegate_factory (connection_delegate_factory const &); // = delete
34
- connection_delegate_factory& operator =(
35
- connection_delegate_factory); // = delete
33
+ connection_delegate_factory (connection_delegate_factory const &) = delete ;
34
+ connection_delegate_factory &operator =(connection_delegate_factory) = delete ;
36
35
};
37
36
38
37
} // namespace http
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ connection_delegate_factory::connection_delegate_ptr connection_delegate_factory
33
33
if (https) {
34
34
#ifdef NETWORK_ENABLE_HTTPS
35
35
NETWORK_MESSAGE (" creating an SSL delegate" );
36
- delegate.reset (new ssl_delegate (service, options));
36
+ std::shared_ptr<ssl_delegate> delegate_ptr (new ssl_delegate (service, options));
37
+ delegate = std::move (delegate_ptr);
37
38
#else
38
39
NETWORK_MESSAGE (" creating an SSL delegate, but not supported" );
39
40
BOOST_THROW_EXCEPTION (std::runtime_error (" HTTPS not supported." ));
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ struct normal_delegate : connection_delegate {
41
41
boost::asio::io_service& service_;
42
42
std::unique_ptr<boost::asio::ip::tcp::socket> socket_;
43
43
44
- normal_delegate (normal_delegate const &); // = delete
45
- normal_delegate& operator =(normal_delegate); // = delete
44
+ normal_delegate (normal_delegate const &) = delete ;
45
+ normal_delegate& operator =(normal_delegate) = delete ;
46
46
};
47
47
48
48
} // namespace http
Original file line number Diff line number Diff line change 11
11
#include < boost/asio/ssl.hpp>
12
12
#include < network/protocol/http/client/connection/connection_delegate.hpp>
13
13
#include < network/protocol/http/client/options.hpp>
14
- #include < boost/enable_shared_from_this.hpp>
15
14
16
15
namespace boost {
17
16
namespace asio {
@@ -23,7 +22,7 @@ namespace network {
23
22
namespace http {
24
23
25
24
struct ssl_delegate : connection_delegate,
26
- boost ::enable_shared_from_this<ssl_delegate> {
25
+ std ::enable_shared_from_this<ssl_delegate> {
27
26
ssl_delegate (boost::asio::io_service& service, client_options const & options);
28
27
29
28
virtual void connect (
Original file line number Diff line number Diff line change 10
10
#include < network/protocol/http/client/options.hpp>
11
11
#include < network/protocol/http/client/connection/ssl_delegate.hpp>
12
12
#include < boost/asio/placeholders.hpp>
13
- #include < functional>
14
13
#include < network/detail/debug.hpp>
15
14
16
15
network::http::ssl_delegate::ssl_delegate (boost::asio::io_service& service,
@@ -48,8 +47,7 @@ void network::http::ssl_delegate::connect(
48
47
} else {
49
48
NETWORK_MESSAGE (" not verifying peer" );
50
49
context_->set_default_verify_paths ();
51
- context_->set_verify_mode (boost::asio::ssl::context::verify_peer);
52
- context_->set_verify_callback (boost::asio::ssl::rfc2818_verification (host));
50
+ context_->set_verify_mode (boost::asio::ssl::context::verify_none);
53
51
}
54
52
socket_.reset (new boost::asio::ssl::stream<
55
53
boost::asio::ip::tcp::socket>(service_, *context_));
You can’t perform that action at this time.
0 commit comments