diff --git a/src/Config.h b/src/Config.h index edc7930c7..4e97f6fdb 100644 --- a/src/Config.h +++ b/src/Config.h @@ -89,6 +89,7 @@ #define SERVER "powdertoy.co.uk" #define STATICSCHEME "https://" #define STATICSERVER "static.powdertoy.co.uk" +#define ENFORCE_HTTPS #define LOCAL_SAVE_DIR "Saves" diff --git a/src/client/http/Request.cpp b/src/client/http/Request.cpp index 6301bc23a..d42bf024e 100644 --- a/src/client/http/Request.cpp +++ b/src/client/http/Request.cpp @@ -157,6 +157,14 @@ namespace http #endif curl_easy_setopt(easy, CURLOPT_FOLLOWLOCATION, 1L); +#ifdef ENFORCE_HTTPS + curl_easy_setopt(easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS); + curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS); +#else + curl_easy_setopt(easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP); + curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP); +#endif + curl_easy_setopt(easy, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_easy_setopt(easy, CURLOPT_MAXREDIRS, 10L); curl_easy_setopt(easy, CURLOPT_ERRORBUFFER, error_buffer);