Skip to content

Commit 7c5ba9e

Browse files
authored
Merge pull request #41 from fmoessbauer/fix/verify-peer
fix: check peers certificate when using https transport
2 parents 7384aa7 + a9f89a2 commit 7c5ba9e

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

src/HTTP.cxx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ void HTTP::initCurl(const std::string &url)
7777
}
7878
writeHandle = curl_easy_init();
7979
curl_easy_setopt(writeHandle, CURLOPT_URL, writeUrl.c_str());
80-
curl_easy_setopt(writeHandle, CURLOPT_SSL_VERIFYPEER, 0);
8180
curl_easy_setopt(writeHandle, CURLOPT_CONNECTTIMEOUT, 10);
8281
curl_easy_setopt(writeHandle, CURLOPT_TIMEOUT, 10);
8382
curl_easy_setopt(writeHandle, CURLOPT_POST, 1);
@@ -97,7 +96,6 @@ void HTTP::initCurlRead(const std::string &url)
9796
mReadUrl = url + "&q=";
9897
mReadUrl.insert(mReadUrl.find('?'), "/query");
9998
readHandle = curl_easy_init();
100-
curl_easy_setopt(readHandle, CURLOPT_SSL_VERIFYPEER, 0);
10199
curl_easy_setopt(readHandle, CURLOPT_CONNECTTIMEOUT, 10);
102100
curl_easy_setopt(readHandle, CURLOPT_TIMEOUT, 10);
103101
curl_easy_setopt(readHandle, CURLOPT_TCP_KEEPIDLE, 120L);
@@ -128,12 +126,6 @@ void HTTP::enableBasicAuth(const std::string &auth)
128126
curl_easy_setopt(readHandle, CURLOPT_USERPWD, auth.c_str());
129127
}
130128

131-
void HTTP::enableSsl()
132-
{
133-
curl_easy_setopt(readHandle, CURLOPT_SSL_VERIFYPEER, 0L);
134-
curl_easy_setopt(writeHandle, CURLOPT_SSL_VERIFYPEER, 0L);
135-
}
136-
137129
void HTTP::send(std::string &&lineprotocol)
138130
{
139131
CURLcode response;
@@ -206,7 +198,6 @@ void HTTP::createDatabase()
206198

207199
CURL *createHandle = curl_easy_init();
208200
curl_easy_setopt(createHandle, CURLOPT_URL, createUrl.c_str());
209-
curl_easy_setopt(createHandle, CURLOPT_SSL_VERIFYPEER, 0);
210201
curl_easy_setopt(createHandle, CURLOPT_CONNECTTIMEOUT, 10);
211202
curl_easy_setopt(createHandle, CURLOPT_TIMEOUT, 10);
212203
curl_easy_setopt(createHandle, CURLOPT_POST, 1);

src/HTTP.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ class HTTP : public Transport
6161
/// \param auth <username>:<password>
6262
void enableBasicAuth(const std::string &auth);
6363

64-
/// Enable SSL
65-
void enableSsl();
66-
6764
/// Get the database name managed by this transport
6865
[[nodiscard]] std::string databaseName() const;
6966

src/InfluxDBFactory.cxx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ std::unique_ptr<Transport> withHttpTransport(const http::url &uri)
7272
{
7373
transport->enableBasicAuth(uri.user + ":" + uri.password);
7474
}
75-
76-
if (uri.protocol == "https")
77-
{
78-
transport->enableSsl();
79-
}
8075
return transport;
8176
}
8277

0 commit comments

Comments
 (0)