Thread 'Firewall issues on Windows'

Message boards : API : Firewall issues on Windows
Message board moderation

To post messages, you must log in.

AuthorMessage
Christian Krause

Send message
Joined: 9 May 22
Posts: 5
Message 108043 - Posted: 9 May 2022, 21:05:18 UTC

I'm using the BOINC wrapper. My main app is written in C++ and needs to download additional content from the Internet during its computation. It tries to download the content by invoking the curl and git commands (using system()). On Linux and MacOS this works fine, but on Windows I run into two issues:

1. The PATH environment variable is not set. I need to populate it with the paths where curl and git are installed.

2. The curl and git fail because the network communication was blocked:

fatal: unable to access 'https://...': getaddrinfo() thread failed to start

I found a Stackoverflow post on this error: the problem seems to be that the Windows Defender Firewall is blocking the http requests. If I run the commands directly in the Command Prompt, they work.

How can I avoid that my app's http requests get blocked by the Windows firewall?
ID: 108043 · Report as offensive
ProfileDave
Help desk expert

Send message
Joined: 28 Jun 10
Posts: 2709
United Kingdom
Message 108044 - Posted: 9 May 2022, 21:24:19 UTC

Not a windows user but I understand the windows firewall can be configured so if you can check which port is used, you can allow that for the script?
ID: 108044 · Report as offensive
Christian Krause

Send message
Joined: 9 May 22
Posts: 5
Message 108048 - Posted: 10 May 2022, 16:32:11 UTC - in response to Message 108044.  

I'm using only https (443) and http (80). I did not configure anything specialy in the Windows Defender settings, so I assume it behaves the same on all default configurations. It seems like Windows considers the app as potentially malicious and sandboxes it. I'm wondering if other apps have managed to work around it and how to make it work without asking BOINC users "please disable your (standard) Windows Defender".
ID: 108048 · Report as offensive
robsmith
Volunteer tester
Help desk expert

Send message
Joined: 25 May 09
Posts: 1301
United Kingdom
Message 108049 - Posted: 10 May 2022, 17:29:25 UTC - in response to Message 108048.  

Check that Windows Defender (firewall) has BOINC and the applications "white listed" - this does not always happen by default and can be "fun" to get working as you require.
ID: 108049 · Report as offensive
Christian Krause

Send message
Joined: 9 May 22
Posts: 5
Message 108059 - Posted: 11 May 2022, 19:18:20 UTC - in response to Message 108049.  

I found out that it is not caused by the firewall. I can reproduce the problem as follows:

1. Open Command Prompt
2. Unset the environment variable SYSTEMROOT
3. Run curl

=> same error. So it is caused by the fact that the wrapper starts my app without any default environment variables set. Same applies to PATH by the way. Is it really intended that the wrapper wipes out the entire environment variables before starting the app ?
ID: 108059 · Report as offensive

Message boards : API : Firewall issues on Windows

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.