@@ -21,6 +21,7 @@ class client_options {
2121 public:
2222 typedef typename string<Tag>::type string_type;
2323
24+ // / Set all the options to default.
2425 client_options ()
2526 : cache_resolved_(false ),
2627 follow_redirects_ (false ),
@@ -32,7 +33,7 @@ class client_options {
3233 openssl_sni_hostname_(),
3334 openssl_options_(0 ),
3435 io_service_(),
35- always_verify_peer_(false ),
36+ always_verify_peer_(true ),
3637 timeout_(0 ) {}
3738
3839 client_options (client_options const & other)
@@ -70,61 +71,84 @@ class client_options {
7071 swap (timeout_, other.timeout_ );
7172 }
7273
74+ // / Specify whether the client should cache resolved endpoints.
75+ // /
76+ // / Default: false.
7377 client_options& cache_resolved (bool v) {
7478 cache_resolved_ = v;
7579 return *this ;
7680 }
7781
82+ // / Specify whether the client should follow redirects.
83+ // /
84+ // / Default: false.
85+ // / \deprecated Not supported by asynchronous client implementation.
7886 client_options& follow_redirects (bool v) {
7987 follow_redirects_ = v;
8088 return *this ;
8189 }
8290
91+ // / Set the filename of the certificate to load for the SSL connection for
92+ // / verification.
8393 client_options& openssl_certificate (string_type const & v) {
8494 openssl_certificate_ = v;
8595 return *this ;
8696 }
8797
98+ // / Set the directory for which the certificate authority files are located.
8899 client_options& openssl_verify_path (string_type const & v) {
89100 openssl_verify_path_ = v;
90101 return *this ;
91102 }
92103
104+ // / Set the filename of the certificate to use for client-side SSL session
105+ // / establishment.
93106 client_options& openssl_certificate_file (string_type const & v) {
94107 openssl_certificate_file_ = v;
95108 return *this ;
96109 }
97110
111+ // / Set the filename of the private key to use for client-side SSL session
112+ // / establishment.
98113 client_options& openssl_private_key_file (string_type const & v) {
99114 openssl_private_key_file_ = v;
100115 return *this ;
101116 }
102117
118+ // / Set the ciphers to support for SSL negotiation.
103119 client_options& openssl_ciphers (string_type const & v) {
104120 openssl_ciphers_ = v;
105121 return *this ;
106122 }
107123
124+ // / Set the hostname for SSL SNI hostname support.
108125 client_options& openssl_sni_hostname (string_type const & v) {
109126 openssl_sni_hostname_ = v;
110127 return *this ;
111128 }
112129
130+ // / Set the raw OpenSSL options to use for HTTPS requests.
113131 client_options& openssl_options (long o) {
114132 openssl_options_ = o;
115133 return *this ;
116134 }
117135
136+ // / Provide an `asio::io_service` hosted in a shared pointer.
118137 client_options& io_service (std::shared_ptr<asio::io_service> v) {
119138 io_service_ = v;
120139 return *this ;
121140 }
122141
142+ // / Set whether we always verify the peer on the other side of the HTTPS
143+ // / connection.
144+ // /
145+ // / Default: true.
123146 client_options& always_verify_peer (bool v) {
124147 always_verify_peer_ = v;
125148 return *this ;
126149 }
127150
151+ // / Set an overall timeout for HTTP requests.
128152 client_options& timeout (int v) {
129153 timeout_ = v;
130154 return *this ;
0 commit comments