Skip to content

Commit

Permalink
improve: upgrade curl to use TLS version 1.2 (opentibiabr#705)
Browse files Browse the repository at this point in the history
This change updates the version of curl used in the project to version 7.64.0 or above, which includes support for Transport Layer Security (TLS) version 1.2. This update ensures that the project is using the most secure version of the protocol and is in compliance with industry security standards.
  • Loading branch information
beats-dh authored and dudantas committed Feb 7, 2023
1 parent aefda68 commit a7d2b1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/map/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ bool Map::loadMap(const std::string& identifier,
FILE *otbm = fopen(identifier.c_str(), "wb");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_URL, mapDownloadUrl.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEDATA, otbm);
curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, otbm);
curl_easy_perform(curl);
curl_easy_cleanup(curl);
fclose(otbm);
Expand Down
3 changes: 2 additions & 1 deletion src/server/network/webhook/webhook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ static int webhook_send_message_(const char *url, const char *payload, std::stri
}

curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, reinterpret_cast<void *>(&response_body));
Expand All @@ -133,7 +134,7 @@ static int webhook_send_message_(const char *url, const char *payload, std::stri
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
} else {
SPDLOG_ERROR("Failed to send webhook message with the error: {}",
curl_easy_strerror(res));
curl_easy_strerror(res));
}

curl_easy_cleanup(curl);
Expand Down

0 comments on commit a7d2b1a

Please sign in to comment.