Skip to content

Commit abc1896

Browse files
author
jhazik
committed
Minor improvements
1 parent fe7fe15 commit abc1896

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

httplib.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ class ClientImpl {
15461546
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
15471547
void set_ca_cert_path(const std::string &ca_cert_file_path,
15481548
const std::string &ca_cert_dir_path = std::string());
1549-
void set_ca_cert_store(X509_STORE *ca_cert_store);
1549+
virtual void set_ca_cert_store(X509_STORE *ca_cert_store);
15501550
X509_STORE *create_ca_cert_store(const char *ca_cert, std::size_t size) const;
15511551
#endif
15521552

@@ -11857,7 +11857,7 @@ inline void Client::set_ca_cert_path(const std::string &ca_cert_file_path,
1185711857

1185811858
inline void Client::set_ca_cert_store(X509_STORE *ca_cert_store) {
1185911859
if (is_ssl_) {
11860-
static_cast<SSLClient &>(*cli_).set_ca_cert_store(ca_cert_store);
11860+
dynamic_cast<SSLClient &>(*cli_).set_ca_cert_store(ca_cert_store);
1186111861
} else {
1186211862
cli_->set_ca_cert_store(ca_cert_store);
1186311863
}
@@ -11869,13 +11869,13 @@ inline void Client::load_ca_cert_store(const char *ca_cert, std::size_t size) {
1186911869

1187011870
inline long Client::get_openssl_verify_result() const {
1187111871
if (is_ssl_) {
11872-
return static_cast<SSLClient &>(*cli_).get_openssl_verify_result();
11872+
return dynamic_cast<SSLClient &>(*cli_).get_openssl_verify_result();
1187311873
}
1187411874
return -1; // NOTE: -1 doesn't match any of X509_V_ERR_???
1187511875
}
1187611876

1187711877
inline SSL_CTX *Client::ssl_context() const {
11878-
if (is_ssl_) { return static_cast<SSLClient &>(*cli_).ssl_context(); }
11878+
if (is_ssl_) { return dynamic_cast<SSLClient &>(*cli_).ssl_context(); }
1187911879
return nullptr;
1188011880
}
1188111881
#endif

0 commit comments

Comments
 (0)