How to set proxy for MAS version?

Support for macOS users
Post Reply
toaruScar
Posts: 2
Joined: 25 Mar 2023, 07:41

How to set proxy for MAS version?

Post by toaruScar »

Hi,

How can I change the proxy setting for FileBot Mac App Store version? I want it to go thru a sock5 proxy runs on localhost, because thetvdb.com domain is blocked.

I tried to modify

Code: Select all

/Applications/FileBot.app/Contents/PlugIns/openjdk.jre/Contents/Home/conf/net.properties
, by adding these two lines

Code: Select all

socksProxyHost=127.0.0.1
socksProxyPort=1080
but it didn't work. I still the the same error saying

Code: Select all

Mar 25, 2023 3:04:41 PM net.filebot.CachedResource retry
警告: Fetch failed: Try again in 2 seconds (2 more) => java.net.SocketTimeoutException: Read timed out
Mar 25, 2023 3:10:12 PM net.filebot.CachedResource retry
警告: Fetch failed: Try again in 2 seconds (2 more) => java.net.SocketTimeoutException: Read timed out
Mar 25, 2023 3:11:18 PM net.filebot.CachedResource retry
警告: Fetch failed: Try again in 2 seconds (2 more) => javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching api.thetvdb.com found.
Mar 25, 2023 3:11:21 PM net.filebot.CachedResource retry
警告: Fetch failed: Try again in 8 seconds (1 more) => javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching api.thetvdb.com found.
Mar 25, 2023 3:11:30 PM net.filebot.CachedResource lambda$get$2
严重: Failed to fetch resource: No subject alternative DNS name matching api.thetvdb.com found.
Mar 25, 2023 3:11:30 PM net.filebot.ui.AbstractSearchPanel$SearchTask done
警告: No subject alternative DNS name matching api.thetvdb.com found.
I made sure that the proxy server running at this port works, so it seems that problem is FileBot not respecting these settings?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to set proxy for MAS version?

Post by rednoah »

FileBot will inherit your system settings by default. This should work for HTTP proxies at the very least.


I don't know if the JRE supports socks5 proxies at all. Modifying the application bundle is definitely not supported though, since that will break code signatures, which in turn can lead to macOS / Gate Keeper not allowing you to run the application.


As a last resort, you can always use a VPN that transparently tunnels all network traffic.


:?: Which country blocks TheTVDB services? If the block is not sophisticated, i.e. not China, then using a different DNS, e.g. Cloud Flare 1.1.1.1, might just allow you to bypass the restrictions.




EDIT:

Note that FileBot can read and apply Java System Properties on startup:
viewtopic.php?t=3913

:!: The MAS doesn't allow command-line tools, so you will have to write the system.properties configuration file manually:

Code: Select all

/Users/me/Library/Containers/net.filebot.FileBot/Data/Library/Application Support/User Data/system.properties

Code: Select all

socksProxyHost=127.0.0.1
socksProxyPort=1080
:idea: Please read the FAQ and How to Request Help.
toaruScar
Posts: 2
Joined: 25 Mar 2023, 07:41

Re: How to set proxy for MAS version?

Post by toaruScar »

rednoah wrote: 25 Mar 2023, 09:17 FileBot will inherit your system settings by default. This should work for HTTP proxies at the very least.
My system proxy is proxy auto config (PAC) that assigns socks5 proxy based on domain name, I don't think that worked for FileBot.
rednoah wrote: 25 Mar 2023, 09:17As a last resort, you can always use a VPN that transparently tunnels all network traffic.
I tried to use an app called Proxifier to force all traffic from FileBot to go thru a proxy, which worked for TVMaze (means that Proxifier picked up and proxyed the connections to tvmaze from FileBot, but when I try to use thetvdb, it did not pick up any connection).

After applying the config at

Code: Select all

/Users/me/Library/Containers/net.filebot.FileBot/Data/Library/Application Support/User Data/system.properties
, I still get the same error. Based on the error FileBots generates, it seems that FileBot still tries to do a DNS lookup dispite there're settings asking it to use a a socks5 proxy. With a socks5 proxy, DNS lookups sould be done remotely.

Anyway, it seems that my ISP pollutes the DNS lookup result for thetvdb API. So an entry in /etc/hosts is a workaround that solved my problem.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to set proxy for MAS version?

Post by rednoah »

I don't actually know how the JRE resolves host names. I'd assume that it's using the OS system services for DNS lookup. Using a custom local DNS server in the macOS settings might work, or manually adding IPs to /etc/hosts as you have already done.
:idea: Please read the FAQ and How to Request Help.
Post Reply