Skip to content

Enable SSL certificate verification for PlayFab API requests - #200

Merged
Raul Gomez Rodriguez (rgomez391) merged 1 commit into
mainfrom
raulgomez/fix-ssl-verifypeer-62661974
Jun 26, 2026
Merged

Enable SSL certificate verification for PlayFab API requests#200
Raul Gomez Rodriguez (rgomez391) merged 1 commit into
mainfrom
raulgomez/fix-ssl-verifypeer-62661974

Conversation

@rgomez391

Copy link
Copy Markdown
Contributor

Summary

Enables TLS certificate verification for all PlayFab API requests in the C++ GSDK.

Previously, CURLOPT_SSL_VERIFYPEER was set to false in PlayFabHttp.cpp, disabling SSL certificate verification for every PlayFab API call. This exposed the developer's secret API key and all API traffic to man-in-the-middle (MITM) interception. The disabling was a temporary workaround (// TODO: Replace this with a ca-bundle ref???) that was never resolved.

Fix

Set CURLOPT_SSL_VERIFYPEER to true, matching the resolution already shipped in the sibling SDK PlayFab/XPlatCppSdk. CURLOPT_SSL_VERIFYHOST remains at its secure default (2).

Testing

  • Configured and built the C++ GSDK with CMake (VS 2022 / MSVC) — compiles cleanly, no new warnings or errors.

Notes

  • After this change, debugging proxies like Fiddler will no longer transparently intercept these calls unless their root cert is trusted by the system — this is the intended, secure behavior.

Resolves AB#62661974

CURLOPT_SSL_VERIFYPEER was set to false, disabling TLS certificate verification for all PlayFab API requests and exposing the secret API key and traffic to man-in-the-middle attacks. Set it to true to match the upstream XPlatCppSdk fix. Resolves AB#62661974.

@tculotta tculotta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@rgomez391
Raul Gomez Rodriguez (rgomez391) merged commit f881377 into main Jun 26, 2026
2 checks passed
@rgomez391
Raul Gomez Rodriguez (rgomez391) deleted the raulgomez/fix-ssl-verifypeer-62661974 branch June 26, 2026 16:04
Dimitris Gkanatsios (dgkanatsios) added a commit that referenced this pull request Aug 7, 2026
Removes the vendored PlayFab REST API SDK (cpp/cppsdk/source/playfab and
cpp/cppsdk/include/playfab), a fork of XPlatCppSdk frozen at 2.0.180420
(April 2018). It is dead code: not compiled by CMakeLists.txt or the
Windows project, not linked into a game server even when compiled (zero
PlayFabHttp symbols on either platform), and not shipped, since the
NuGet package exports only gsdk.h.

This also reverts #200, which set CURLOPT_SSL_VERIFYPEER to true in
PlayFabHttp.cpp. Verified on both platforms that it had no effect on any
shipped artifact: with the PR applied versus reverted, the library and
game server binaries are byte-identical. The GSDK heartbeat to the VM
Agent was never affected either way, as it uses a separate curl handle
over a hardcoded plain-HTTP URL.

It was not a safe no-op if that code were ever revived on Windows,
though. The bundled libcurl links OpenSSL 1.1, which ignores the Windows
certificate store, and no CA bundle ships with the SDK, so the request
fails with curl error 60. The deleted "TODO: Replace this with a
ca-bundle ref???" comment described the work still outstanding. Removing
the code retires that risk rather than leaving a broken path behind.

Games needing PlayFab APIs should use PlayFab/XPlatCppSdk directly.

Also strips the PlayFab calls from cppLinuxTestApp, drops the now inert
DISABLE_PLAYFABCLIENT_API define from the Windows test apps, and makes
gsdk.h self-contained. The public header used uint32_t and tm unqualified
without including the relevant headers, so it now includes both the C and
C++ spellings: the C compatibility headers guarantee the global names it
relies on, the C++ headers keep std::tm and std::uint32_t available to
consumers.

Verified on Linux (SDK, both test apps, consumer game server, gsdk.h
standalone under C++11/14/17/20 with -pedantic) and Windows (shipped
library, unit tests 15/15 passing), plus end-to-end runs against
LocalMultiplayerAgent on both platforms showing an unchanged lifecycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants