@@ -178,6 +178,8 @@ private void cb_brake_CheckedChanged(object sender, EventArgs e)
178
178
179
179
private void Form1_Load ( object sender , EventArgs e )
180
180
{
181
+ System . Net . ServicePointManager . SecurityProtocol = SecurityProtocolType . Tls11 | SecurityProtocolType . Tls12 ; //disable TLS 1.0
182
+
181
183
cbts_disp1short . ComboBox . BindingContext = this . BindingContext ;
182
184
cbts_disp1short . ComboBox . DataSource = new BindingSource ( ACTIONS , null ) ;
183
185
cbts_disp1long . ComboBox . BindingContext = this . BindingContext ;
@@ -273,10 +275,10 @@ private string get_githubversion()
273
275
string line = "" ;
274
276
updatetext = "" ;
275
277
WebClient webClient = new WebClient ( ) ;
276
-
277
278
tb_console . AppendText ( "\r \n checking for version" ) ;
278
279
try
279
280
{
281
+ webClient . Headers . Add ( "user-agent" , "foo" ) ;
280
282
webClient . DownloadFile ( "https://raw.githubusercontent.com/jenkie/Arduino-Pedelec-Configurator/master/version.txt" , appPath + @"\version.txt" ) ;
281
283
webClient . Dispose ( ) ;
282
284
if ( System . IO . File . Exists ( appPath + @"\version.txt" ) )
@@ -303,8 +305,8 @@ private void download_newapc()
303
305
tb_console . AppendText ( "\r \n dowloading new APC from github" ) ;
304
306
try
305
307
{
306
- System . Net . ServicePointManager . SecurityProtocol = System . Net . SecurityProtocolType . Tls12 ;
307
- webClient . DownloadFile ( "https://codeload .github.com/jenkie/Arduino-Pedelec-Configurator/legacy.zip /master" , appPath + @"\updated_apc.zip" ) ;
308
+ webClient . Headers . Add ( "user-agent" , "foo" ) ;
309
+ webClient . DownloadFile ( "https://api .github.com/repos/ jenkie/Arduino-Pedelec-Configurator/zipball /master" , appPath + @"\updated_apc.zip" ) ;
308
310
webClient . Dispose ( ) ;
309
311
MessageBox . Show ( "I will quit now. Extract everything from updated_apc.zip to the application directory and restart this Software." ) ;
310
312
System . Diagnostics . Process . Start ( appPath + @"\updated_apc.zip" ) ;
@@ -680,17 +682,17 @@ private void bt_delete_Click(object sender, EventArgs e)
680
682
private void download_github_sources ( )
681
683
{
682
684
WebClient webClient = new WebClient ( ) ;
683
-
684
- tb_console . AppendText ( " \r \n cleaning up sources" ) ;
685
- foreach ( string directory in System . IO . Directory . EnumerateDirectories ( sourcePath_online ) )
686
- {
687
- System . IO . Directory . Delete ( directory , true ) ;
688
- }
689
- System . IO . Directory . CreateDirectory ( sourcePath_online ) ;
690
- tb_console . AppendText ( "...done \r \n downloading sources" ) ;
691
- try {
692
- System . Net . ServicePointManager . SecurityProtocol = System . Net . SecurityProtocolType . Tls12 ;
693
- webClient . DownloadFile ( "https://codeload .github.com/jenkie/Arduino-Pedelec-Controller/legacy.zip /apc" + appVersion , sourcePath_online + @"\git_down.zip" ) ;
685
+ tb_console . AppendText ( " \r \n cleaning up sources" ) ;
686
+ foreach ( string directory in System . IO . Directory . EnumerateDirectories ( sourcePath_online ) )
687
+ {
688
+ System . IO . Directory . Delete ( directory , true ) ;
689
+ }
690
+ System . IO . Directory . CreateDirectory ( sourcePath_online ) ;
691
+ tb_console . AppendText ( "...done \r \n downloading sources" ) ;
692
+ try
693
+ {
694
+ webClient . Headers . Add ( "user-agent" , "foo" ) ;
695
+ webClient . DownloadFile ( "https://api .github.com/repos/ jenkie/Arduino-Pedelec-Controller/zipball /apc" + appVersion , sourcePath_online + @"\git_down.zip" ) ;
694
696
}
695
697
catch ( Exception ex )
696
698
{
0 commit comments