-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix #2217 #2218
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
Fix #2217 #2218
Conversation
@JakubHazik thanks for the pull request. Could you take a look at the GitHub Actions workflow failures and compiler warnings? (You don't need to worry about the |
@@ -1546,7 +1546,7 @@ class ClientImpl { | |||
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT | |||
void set_ca_cert_path(const std::string &ca_cert_file_path, | |||
const std::string &ca_cert_dir_path = std::string()); | |||
void set_ca_cert_store(X509_STORE *ca_cert_store); | |||
virtual void set_ca_cert_store(X509_STORE *ca_cert_store); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove virtual
. It's not necessary.
@@ -11857,7 +11860,7 @@ inline void Client::set_ca_cert_path(const std::string &ca_cert_file_path, | |||
|
|||
inline void Client::set_ca_cert_store(X509_STORE *ca_cert_store) { | |||
if (is_ssl_) { | |||
static_cast<SSLClient &>(*cli_).set_ca_cert_store(ca_cert_store); | |||
dynamic_cast<SSLClient &>(*cli_).set_ca_cert_store(ca_cert_store); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert it to static_cast
?
@@ -11869,13 +11872,13 @@ inline void Client::load_ca_cert_store(const char *ca_cert, std::size_t size) { | |||
|
|||
inline long Client::get_openssl_verify_result() const { | |||
if (is_ssl_) { | |||
return static_cast<SSLClient &>(*cli_).get_openssl_verify_result(); | |||
return dynamic_cast<SSLClient &>(*cli_).get_openssl_verify_result(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert it to static_cast
, too?
} | ||
return -1; // NOTE: -1 doesn't match any of X509_V_ERR_??? | ||
} | ||
|
||
inline SSL_CTX *Client::ssl_context() const { | ||
if (is_ssl_) { return static_cast<SSLClient &>(*cli_).ssl_context(); } | ||
if (is_ssl_) { return dynamic_cast<SSLClient &>(*cli_).ssl_context(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert it to static_cast
, too?
@JakubHazik I made come comments. After the adjustments are made, could you please run clang-format, so that |
I made the adjustments for you at eb5a65e. :) |
Try resolve #2217
Transmit X509_STORE between SSLClient-s during redirect.
Make variable
ca_cert_store_
reusable between multiple clients