Add: use https:// for content-service connections (#10448)

This requires the use of WinHTTP (for Windows) or libcurl (for all
others except Emscripten). Emscripten does not support http(s)
calls currently.

On Linux it requires ca-certificates to be installed, so the HTTPS
certificate can be validated. It is really likely this is installed
on any modern machine, as most connections these days are HTTPS.

(On MacOS and Windows the certificate store is filled by default)

Reminder: in case the http(s):// connection cannot be established,
OpenTTD falls back to a custom TCP-based connection to fetch the
content from the content-service. Emscripten will always do this.
This commit is contained in:
Patric Stout
2023-02-12 12:07:31 +01:00
committed by GitHub
parent 09f7f32b8d
commit 64523709bf
19 changed files with 705 additions and 464 deletions

View File

@@ -59,11 +59,11 @@ const char *NetworkContentServerConnectionString()
}
/**
* Get the connection string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_CS,
* or when it has not been set a hard coded default DNS hostname of the production server.
* @return The content mirror's connection string.
* Get the URI string for the content mirror from the environment variable OTTD_CONTENT_MIRROR_URI,
* or when it has not been set a hard coded URI of the production server.
* @return The content mirror's URI string.
*/
const char *NetworkContentMirrorConnectionString()
const char *NetworkContentMirrorUriString()
{
return GetEnv("OTTD_CONTENT_MIRROR_CS", "binaries.openttd.org");
return GetEnv("OTTD_CONTENT_MIRROR_URI", "https://binaries.openttd.org/bananas");
}