mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-20 23:21:20 +02:00
Prevent protocol downgrade attacks
This commit is contained in:
@@ -89,6 +89,7 @@
|
|||||||
#define SERVER "powdertoy.co.uk"
|
#define SERVER "powdertoy.co.uk"
|
||||||
#define STATICSCHEME "https://"
|
#define STATICSCHEME "https://"
|
||||||
#define STATICSERVER "static.powdertoy.co.uk"
|
#define STATICSERVER "static.powdertoy.co.uk"
|
||||||
|
#define ENFORCE_HTTPS
|
||||||
|
|
||||||
#define LOCAL_SAVE_DIR "Saves"
|
#define LOCAL_SAVE_DIR "Saves"
|
||||||
|
|
||||||
|
@@ -157,6 +157,14 @@ namespace http
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
curl_easy_setopt(easy, CURLOPT_FOLLOWLOCATION, 1L);
|
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_MAXREDIRS, 10L);
|
||||||
|
|
||||||
curl_easy_setopt(easy, CURLOPT_ERRORBUFFER, error_buffer);
|
curl_easy_setopt(easy, CURLOPT_ERRORBUFFER, error_buffer);
|
||||||
|
Reference in New Issue
Block a user