@@ -20,7 +20,8 @@ private static string PythonDownloadUrl
2020 return string . Format ( "https://www.python.org/ftp/python/{0}/python-{0}-embed-{1}.zip" , CurrentPythonVersion , arch ) ;
2121 }
2222 }
23- public static string AppDataDirectory {
23+ public static string AppDataDirectory
24+ {
2425 get
2526 {
2627 var roamingFolder = Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) ;
@@ -37,7 +38,7 @@ public static string AppDataDirectory {
3738
3839 public static void DownloadAndInstallCli ( )
3940 {
40- Logger . Debug ( "Downloading wakatime-cli..." ) ;
41+ Logger . Debug ( "Downloading wakatime-cli..." ) ;
4142 var destinationDir = AppDataDirectory ;
4243 var localZipFile = Path . Combine ( destinationDir , "wakatime-cli.zip" ) ;
4344
@@ -71,8 +72,7 @@ public static void DownloadAndInstallPython()
7172 var extractToDir = Path . Combine ( destinationDir , "python" ) ;
7273
7374 // Download python
74- var proxy = WakaTimePackage . GetProxy ( ) ;
75- var client = new WebClient { Proxy = proxy } ;
75+ var client = GetWebClient ( ) ;
7676 client . DownloadFile ( url , localZipFile ) ;
7777 Logger . Debug ( "Finished downloading python." ) ;
7878
@@ -110,6 +110,16 @@ internal static string GetPython()
110110 return PythonBinaryLocation ;
111111 }
112112
113+ private static WebClient GetWebClient ( )
114+ {
115+ if ( ! ServicePointManager . SecurityProtocol . HasFlag ( SecurityProtocolType . Tls12 ) )
116+ ServicePointManager . SecurityProtocol |= SecurityProtocolType . Tls12 ;
117+
118+ var proxy = WakaTimePackage . GetProxy ( ) ;
119+
120+ return new WebClient { Proxy = proxy } ;
121+ }
122+
113123 internal static string GetPythonPathFromMicrosoftRegistry ( )
114124 {
115125 try
0 commit comments