@@ -84,7 +84,11 @@ class websocket_client_config
84
84
// / <summary>
85
85
// / Creates a websocket client configuration with default settings.
86
86
// / </summary>
87
- websocket_client_config () : m_sni_enabled(true ) {}
87
+ websocket_client_config () :
88
+ m_sni_enabled (true ),
89
+ m_validate_certificates (true )
90
+ {
91
+ }
88
92
89
93
// / <summary>
90
94
// / Get the web proxy object
@@ -187,13 +191,33 @@ class websocket_client_config
187
191
// / <remarks>If you want all the subprotocols in a comma separated string
188
192
// / they can be directly looked up in the headers using 'Sec-WebSocket-Protocol'.</remarks>
189
193
_ASYNCRTIMP std::vector<::utility::string_t > subprotocols () const ;
194
+
195
+ // / <summary>
196
+ // / Gets the server certificate validation property.
197
+ // / </summary>
198
+ // / <returns>True if certificates are to be verified, false otherwise.</returns>
199
+ bool validate_certificates () const
200
+ {
201
+ return m_validate_certificates;
202
+ }
203
+
204
+ // / <summary>
205
+ // / Sets the server certificate validation property.
206
+ // / </summary>
207
+ // / <param name="validate_certs">False to turn ignore all server certificate validation errors, true otherwise.</param>
208
+ // / <remarks>Note ignoring certificate errors can be dangerous and should be done with caution.</remarks>
209
+ void set_validate_certificates (bool validate_certs)
210
+ {
211
+ m_validate_certificates = validate_certs;
212
+ }
190
213
191
214
private:
192
215
web::web_proxy m_proxy;
193
216
web::credentials m_credentials;
194
217
web::http::http_headers m_headers;
195
218
bool m_sni_enabled;
196
219
utf8string m_sni_hostname;
220
+ bool m_validate_certificates;
197
221
};
198
222
199
223
// / <summary>
0 commit comments