I have a program created in C++ that uses CPR, a cURL wrapper, to make http requests. An alarming number of users are having issues when accessing my endpoints, to which it's only accessible with a VPN on. You would assume immediately that it's a country block or some related issue, however, the user is able to access this endpoint through their browser without a vpn, or any other http client that isnt cURL..
To test, I had a user run a simple request to a JSON endpoint without a VPN:
>curl "https://.../api/endpoint.json"curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
and with a VPN:
>curl "https://.../api/endpoint.json"{ ..endpoint info... (successful)}
As you can see, they can access it only with a vpn when using curl. I know this is a cURL issue because my software also has a bootstrapper, which accesses these same endpoints and downloads files, to which there are no errors happening there (C# code using WebClient).
Here is the basic C++ code:
auto fetched = cpr::Get(cpr::Url{ endpoint });
Additionally, me and the users all mostly have the same cURL version & I had the user try different tls versions, different protocols, no luck.
I couldn't find any solid fixes on here or anywhere - how can I fix this error?