@@ -31,13 +31,16 @@ namespace boost { namespace network { namespace http {
31
31
typedef function<typename resolver_base::resolver_iterator_pair (resolver_type &, string_type const &, string_type const &)> resolver_function_type;
32
32
33
33
struct connection_impl {
34
- typedef function<shared_ptr<connection_impl>(resolver_type &,basic_request<Tag> const &)> get_connection_function;
34
+ typedef function<shared_ptr<connection_impl>(resolver_type &,basic_request<Tag> const &,optional<string_type> const &, optional<string_type> const & )> get_connection_function;
35
35
36
- connection_impl (resolver_type & resolver, bool follow_redirect, string_type const & host, string_type const & port, resolver_function_type resolve, get_connection_function get_connection, bool https)
37
- : pimpl(impl::sync_connection_base<Tag,version_major,version_minor>::new_connection(resolver, resolve, https))
36
+ connection_impl (resolver_type & resolver, bool follow_redirect, string_type const & host, string_type const & port, resolver_function_type resolve, get_connection_function get_connection, bool https, optional<string_type> const & certificate_file=optional<string_type>(), optional<string_type> const & verify_path=optional<string_type>() )
37
+ : pimpl(impl::sync_connection_base<Tag,version_major,version_minor>::new_connection(resolver, resolve, https, certificate_file, verify_path ))
38
38
, resolver_(resolver)
39
39
, connection_follow_redirect_(follow_redirect)
40
- , get_connection_(get_connection) {}
40
+ , get_connection_(get_connection)
41
+ , certificate_filename_(certificate_file)
42
+ , verify_path_(verify_path)
43
+ {}
41
44
42
45
basic_response<Tag> send_request (string_type const & method, basic_request<Tag> request_, bool get_body) {
43
46
return send_request_impl (method, request_, get_body);
@@ -104,7 +107,7 @@ namespace boost { namespace network { namespace http {
104
107
if (location_header != boost::end (location_range)) {
105
108
request_.uri (location_header->second );
106
109
connection_ptr connection_;
107
- connection_ = get_connection_ (resolver_, request_);
110
+ connection_ = get_connection_ (resolver_, request_, certificate_filename_, verify_path_ );
108
111
++count;
109
112
continue ;
110
113
} else throw std::runtime_error (" Location header not defined in redirect response." );
@@ -118,6 +121,7 @@ namespace boost { namespace network { namespace http {
118
121
resolver_type & resolver_;
119
122
bool connection_follow_redirect_;
120
123
get_connection_function get_connection_;
124
+ optional<string_type> certificate_filename_, verify_path_;
121
125
};
122
126
123
127
typedef shared_ptr<connection_impl> connection_ptr;
@@ -126,7 +130,7 @@ namespace boost { namespace network { namespace http {
126
130
host_connection_map host_connections;
127
131
bool follow_redirect_;
128
132
129
- connection_ptr get_connection (resolver_type & resolver, basic_request<Tag> const & request_) {
133
+ connection_ptr get_connection (resolver_type & resolver, basic_request<Tag> const & request_, optional<string_type> const & certificate_filename = optional<string_type>(), optional<string_type> const & verify_path = optional<string_type>() ) {
130
134
string_type index = (request_.host () + ' :' ) + lexical_cast<string_type>(request_.port ());
131
135
connection_ptr connection_;
132
136
typename host_connection_map::iterator it =
@@ -145,9 +149,11 @@ namespace boost { namespace network { namespace http {
145
149
, boost::bind (
146
150
&pooled_connection_policy<Tag,version_major,version_minor>::get_connection,
147
151
this ,
148
- _1, _2
152
+ _1, _2, _3, _4
149
153
)
150
154
, boost::iequals (request_.protocol (), string_type (" https" ))
155
+ , certificate_filename
156
+ , verify_path
151
157
)
152
158
);
153
159
host_connections.insert (std::make_pair (index, connection_));
0 commit comments