Skip to content

Commit

Permalink
MINIFICPP-2486 Simplify code around https
Browse files Browse the repository at this point in the history
Signed-off-by: Ferenc Gerlits <[email protected]>
This closes #1890
  • Loading branch information
szaszm authored and fgerlits committed Nov 12, 2024
1 parent d011670 commit 9bcf7e4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 22 deletions.
1 change: 0 additions & 1 deletion extensions/standard-processors/processors/InvokeHTTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ std::unique_ptr<minifi::http::HTTPClient> InvokeHTTP::createHTTPClientFromMember
setupClientTimeouts(*client, connect_timeout_, read_timeout_);
client->setHTTPProxy(proxy_);
client->setFollowRedirects(follow_redirects_);
client->setPeerVerification(true);
if (send_message_body_ && content_type_)
client->setContentType(*content_type_);
setupClientTransferEncoding(*client, use_chunked_encoding_);
Expand Down
3 changes: 0 additions & 3 deletions libminifi/include/http/BaseHTTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ class BaseHTTPClient {

virtual void set_request_method(HttpRequestMethod method) = 0;

virtual void setPeerVerification(bool peer_verification) = 0;
virtual void setHostVerification(bool host_verification) = 0;

virtual void setHTTPProxy(const HTTPProxy &proxy) = 0;

virtual void setBasicAuth(const std::string& username, const std::string& password) = 0;
Expand Down
3 changes: 0 additions & 3 deletions libminifi/include/http/HTTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ class HTTPClient : public BaseHTTPClient, public core::Connectable {

void set_request_method(http::HttpRequestMethod method) override;

void setPeerVerification(bool peer_verification) override;
void setHostVerification(bool host_verification) override;

void setBasicAuth(const std::string& username, const std::string& password) override;
void clearBasicAuth() override;

Expand Down
15 changes: 0 additions & 15 deletions libminifi/src/http/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,6 @@ void HTTPClient::initialize(http::HttpRequestMethod method, std::string url, std
if (isSecure(url_))
configure_secure_connection();
}

void HTTPClient::setPeerVerification(bool peer_verification) {
if (peer_verification) {
logger_->log_debug("Enabling peer verification");
} else {
logger_->log_warn("Disabling peer verification: the authenticity of https servers will not be verified!");
}
curl_easy_setopt(http_session_.get(), CURLOPT_SSL_VERIFYPEER, peer_verification);
}

void HTTPClient::setHostVerification(bool host_verification) {
logger_->log_debug("{} host verification", host_verification ? "Enabling" : "Disabling");
curl_easy_setopt(http_session_.get(), CURLOPT_SSL_VERIFYHOST, host_verification);
}

void HTTPClient::setBasicAuth(const std::string& username, const std::string& password) {
curl_easy_setopt(http_session_.get(), CURLOPT_USERNAME, username.c_str());
curl_easy_setopt(http_session_.get(), CURLOPT_PASSWORD, password.c_str());
Expand Down

0 comments on commit 9bcf7e4

Please sign in to comment.