Prevent protocol downgrade attacks
This commit is contained in:
parent
89ef7ce216
commit
7158a00f44
@ -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