@@ -21,6 +21,7 @@ class client_options {
21
21
public:
22
22
typedef typename string<Tag>::type string_type;
23
23
24
+ // / Set all the options to default.
24
25
client_options ()
25
26
: cache_resolved_(false ),
26
27
follow_redirects_ (false ),
@@ -32,7 +33,7 @@ class client_options {
32
33
openssl_sni_hostname_(),
33
34
openssl_options_(0 ),
34
35
io_service_(),
35
- always_verify_peer_(false ),
36
+ always_verify_peer_(true ),
36
37
timeout_(0 ) {}
37
38
38
39
client_options (client_options const & other)
@@ -70,61 +71,84 @@ class client_options {
70
71
swap (timeout_, other.timeout_ );
71
72
}
72
73
74
+ // / Specify whether the client should cache resolved endpoints.
75
+ // /
76
+ // / Default: false.
73
77
client_options& cache_resolved (bool v) {
74
78
cache_resolved_ = v;
75
79
return *this ;
76
80
}
77
81
82
+ // / Specify whether the client should follow redirects.
83
+ // /
84
+ // / Default: false.
85
+ // / \deprecated Not supported by asynchronous client implementation.
78
86
client_options& follow_redirects (bool v) {
79
87
follow_redirects_ = v;
80
88
return *this ;
81
89
}
82
90
91
+ // / Set the filename of the certificate to load for the SSL connection for
92
+ // / verification.
83
93
client_options& openssl_certificate (string_type const & v) {
84
94
openssl_certificate_ = v;
85
95
return *this ;
86
96
}
87
97
98
+ // / Set the directory for which the certificate authority files are located.
88
99
client_options& openssl_verify_path (string_type const & v) {
89
100
openssl_verify_path_ = v;
90
101
return *this ;
91
102
}
92
103
104
+ // / Set the filename of the certificate to use for client-side SSL session
105
+ // / establishment.
93
106
client_options& openssl_certificate_file (string_type const & v) {
94
107
openssl_certificate_file_ = v;
95
108
return *this ;
96
109
}
97
110
111
+ // / Set the filename of the private key to use for client-side SSL session
112
+ // / establishment.
98
113
client_options& openssl_private_key_file (string_type const & v) {
99
114
openssl_private_key_file_ = v;
100
115
return *this ;
101
116
}
102
117
118
+ // / Set the ciphers to support for SSL negotiation.
103
119
client_options& openssl_ciphers (string_type const & v) {
104
120
openssl_ciphers_ = v;
105
121
return *this ;
106
122
}
107
123
124
+ // / Set the hostname for SSL SNI hostname support.
108
125
client_options& openssl_sni_hostname (string_type const & v) {
109
126
openssl_sni_hostname_ = v;
110
127
return *this ;
111
128
}
112
129
130
+ // / Set the raw OpenSSL options to use for HTTPS requests.
113
131
client_options& openssl_options (long o) {
114
132
openssl_options_ = o;
115
133
return *this ;
116
134
}
117
135
136
+ // / Provide an `asio::io_service` hosted in a shared pointer.
118
137
client_options& io_service (std::shared_ptr<asio::io_service> v) {
119
138
io_service_ = v;
120
139
return *this ;
121
140
}
122
141
142
+ // / Set whether we always verify the peer on the other side of the HTTPS
143
+ // / connection.
144
+ // /
145
+ // / Default: true.
123
146
client_options& always_verify_peer (bool v) {
124
147
always_verify_peer_ = v;
125
148
return *this ;
126
149
}
127
150
151
+ // / Set an overall timeout for HTTP requests.
128
152
client_options& timeout (int v) {
129
153
timeout_ = v;
130
154
return *this ;
0 commit comments