Skip to content

Document client options #613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion boost/network/protocol/http/client/options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class client_options {
public:
typedef typename string<Tag>::type string_type;

/// Set all the options to default.
client_options()
: cache_resolved_(false),
follow_redirects_(false),
Expand All @@ -32,7 +33,7 @@ class client_options {
openssl_sni_hostname_(),
openssl_options_(0),
io_service_(),
always_verify_peer_(false),
always_verify_peer_(true),
timeout_(0) {}

client_options(client_options const& other)
Expand Down Expand Up @@ -70,61 +71,84 @@ class client_options {
swap(timeout_, other.timeout_);
}

/// Specify whether the client should cache resolved endpoints.
///
/// Default: false.
client_options& cache_resolved(bool v) {
cache_resolved_ = v;
return *this;
}

/// Specify whether the client should follow redirects.
///
/// Default: false.
/// \deprecated Not supported by asynchronous client implementation.
client_options& follow_redirects(bool v) {
follow_redirects_ = v;
return *this;
}

/// Set the filename of the certificate to load for the SSL connection for
/// verification.
client_options& openssl_certificate(string_type const& v) {
openssl_certificate_ = v;
return *this;
}

/// Set the directory for which the certificate authority files are located.
client_options& openssl_verify_path(string_type const& v) {
openssl_verify_path_ = v;
return *this;
}

/// Set the filename of the certificate to use for client-side SSL session
/// establishment.
client_options& openssl_certificate_file(string_type const& v) {
openssl_certificate_file_ = v;
return *this;
}

/// Set the filename of the private key to use for client-side SSL session
/// establishment.
client_options& openssl_private_key_file(string_type const& v) {
openssl_private_key_file_ = v;
return *this;
}

/// Set the ciphers to support for SSL negotiation.
client_options& openssl_ciphers(string_type const& v) {
openssl_ciphers_ = v;
return *this;
}

/// Set the hostname for SSL SNI hostname support.
client_options& openssl_sni_hostname(string_type const& v) {
openssl_sni_hostname_ = v;
return *this;
}

/// Set the raw OpenSSL options to use for HTTPS requests.
client_options& openssl_options(long o) {
openssl_options_ = o;
return *this;
}

/// Provide an `asio::io_service` hosted in a shared pointer.
client_options& io_service(std::shared_ptr<asio::io_service> v) {
io_service_ = v;
return *this;
}

/// Set whether we always verify the peer on the other side of the HTTPS
/// connection.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use a:

/// Default: true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done -- and now changed the default to actually true (!!!?).

///
/// Default: true.
client_options& always_verify_peer(bool v) {
always_verify_peer_ = v;
return *this;
}

/// Set an overall timeout for HTTP requests.
client_options& timeout(int v) {
timeout_ = v;
return *this;
Expand Down
308 changes: 28 additions & 280 deletions libs/network/doc/html/_sources/reference/http_client.txt

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions libs/network/doc/html/contents.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,14 @@ <h3>Navigation</h3>
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html">HTTP Client API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#general">General</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#features">Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#implementations">Implementations</a><ul>
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#synchronous-clients">Synchronous Clients</a></li>
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#asynchronous-clients">Asynchronous Clients</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#client-implementation">Client Implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#member-functions">Member Functions</a><ul>
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#constructors">Constructors</a></li>
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#client-options">Client Options</a></li>
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#http-methods">HTTP Methods</a></li>
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#client-specific">Client-Specific</a></li>
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#streaming-body-handler">Streaming Body Handler</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#generated-documentation">Generated Documentation</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="reference/http_request.html">HTTP Request</a><ul>
Expand Down
Binary file modified libs/network/doc/html/objects.inv
Binary file not shown.
3 changes: 1 addition & 2 deletions libs/network/doc/html/reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ <h3>Navigation</h3>
<li class="toctree-l1"><a class="reference internal" href="reference/http_client.html">HTTP Client API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#general">General</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#features">Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#implementations">Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#client-implementation">Client Implementation</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#member-functions">Member Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#generated-documentation">Generated Documentation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference/http_request.html">HTTP Request</a><ul>
Expand Down
Loading