SSLHandshakeException: Remote host terminated the handshake (Little Snitch blocking connections to *.filebot.net)

Support for macOS users
Post Reply
droffsite
Posts: 4
Joined: 09 Jun 2023, 16:13

SSLHandshakeException: Remote host terminated the handshake (Little Snitch blocking connections to *.filebot.net)

Post by droffsite »

Good morning.

Just purchased a license last night (early this morning, really). I'm not having any luck getting it to activate. I've tried both selecting the license file when prompted during a Rename as well as double-clicking the .psm file per the FAQ: same result. Also tried generic DNS (1.1.1.1, 8.8.8.8), no VPN. Log messages below. Perhaps the license server isn't feeling well?

Also noted that the logging doesn't appear to consistently fully flush. I killed the app when I just now tried again, and cleared ~/.filebot/error.log before restarting it. There several lines from my attempts last night at the top of the file; before killing the application I saw that the previous logs seemed truncated (last line was terminated mid-sentence).

Code: Select all

Jun 09, 2023 9:11:25 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:11:25 PDT 2023]
Jun 09, 2023 9:11:25 AM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 2 seconds (2 more) => javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
Jun 09, 2023 9:11:28 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:11:28 PDT 2023]
Jun 09, 2023 9:11:28 AM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 8 seconds (1 more) => javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
Jun 09, 2023 9:11:36 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:11:36 PDT 2023]
Jun 09, 2023 9:11:36 AM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://license.filebot.net/verify/P50528439: Remote host terminated the handshake
Jun 09, 2023 9:11:36 AM net.filebot.UserInteraction configureLicense
SEVERE: Remote host terminated the handshake
Jun 09, 2023 9:13:00 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:13:00 PDT 2023]
Jun 09, 2023 9:13:00 AM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 2 seconds (2 more) => javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
Jun 09, 2023 9:13:02 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:13:02 PDT 2023]
Jun 09, 2023 9:13:02 AM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 8 seconds (1 more) => javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
Jun 09, 2023 9:13:10 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:13:10 PDT 2023]
Jun 09, 2023 9:13:10 AM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://license.filebot.net/verify/P50528439: Remote host terminated the handshake
Jun 09, 2023 9:13:10 AM net.filebot.UserInteraction configureLicense
SEVERE: Remote host terminated the handshake
Jun 09, 2023 9:15:27 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:15:27 PDT 2023]
Jun 09, 2023 9:15:27 AM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 2 seconds (2 more) => javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
Jun 09, 2023 9:15:29 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:15:29 PDT 2023]
Jun 09, 2023 9:15:29 AM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 8 seconds (1 more) => javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
Jun 09, 2023 9:15:37 AM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 09:15:37 PDT 2023]
Jun 09, 2023 9:15:37 AM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://license.filebot.net/verify/P50528439: Remote host terminated the handshake
Jun 09, 2023 9:15:37 AM net.filebot.UserInteraction configureLicense
SEVERE: Remote host terminated the handshake
Jun 09, 2023 9:16:33 AM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://app.filebot.net/update.xml: Remote host terminated the handshake
Jun 09, 2023 9:16:33 AM net.filebot.Main onStart
WARNING: Failed to check for updates: Remote host terminated the handshake
javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
	at net.filebot.web.WebRequest.httpRequestV2(Unknown Source)
	at net.filebot.web.WebRequest.fetch(Unknown Source)
	at net.filebot.CachedResource.lambda$fetchIfModified$13(Unknown Source)
	at net.filebot.CachedResource.lambda$get$0(Unknown Source)
	at net.filebot.CachedResource.retry(Unknown Source)
	at net.filebot.CachedResource.lambda$get$1(Unknown Source)
	at net.filebot.Cache.computeIf(Unknown Source)
	at net.filebot.CachedResource.get(Unknown Source)
	at net.filebot.Main.checkUpdate(Unknown Source)
	at net.filebot.Main.onStart(Unknown Source)
	at net.filebot.Main.lambda$main$2(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
Caused by: java.io.IOException: Socket is not connected
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remote host terminated the handshake when attempting to activate license

Post by rednoah »

This is indeed a network issue:

Code: Select all

SSLHandshakeException: Remote host terminated the handshake
You seem to not be able to access multiple *.filebot.net services, and this will indeed make FileBot not work correctly, in all kinds of ways, including but not limited to license activation.


:?: Can FileBot connect to TheMovieDB / TheTVDB / etc?
viewtopic.php?t=11790


:arrow: License activation seems to be working for everyone else at this moment, so the issue seem to be specific to your network connection. If your internet connection doesn't work, then I would start by using a different internet connection, e.g. use your phone as hotspot and connect via your phone network.


:idea: The log will flush when you close the application, or if you manually check the print the log from within FileBot. Please read How to Request Help for details.
:idea: Please read the FAQ and How to Request Help.
droffsite
Posts: 4
Joined: 09 Jun 2023, 16:13

Re: Remote host terminated the handshake when attempting to activate license

Post by droffsite »

Switched to mobile hotspot via my phone. Still fails. Quick log check shows

Code: Select all

Jun 09, 2023 1:02:22 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 13:02:22 PDT 2023]
Jun 09, 2023 1:02:22 PM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://license.filebot.net/verify/P50528439: Remote host terminated the handshake
Jun 09, 2023 1:02:22 PM net.filebot.UserInteraction configureLicense
SEVERE: Remote host terminated the handshake
Directly hitting that URL via browser returns {"status": 400, "message": "Bad Request"}. So, network access success, malformed request.

No issues accessing TheMovieDB, TheTVDB, or any other site.
droffsite
Posts: 4
Joined: 09 Jun 2023, 16:13

Re: Remote host terminated the handshake when attempting to activate license

Post by droffsite »

Additional detail that seems relevant given your "in all kinds of ways" comment: I originally tried this last night after successfully matching ~450 movie files. I hit "Rename" and tried both pasting and loading the license file with the same issue.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remote host terminated the handshake when attempting to activate license

Post by rednoah »

Most unusual... I have no idea...


:idea: You could try creating a custom configuration file and trying different things to see if any of them makes a difference:

Code: Select all

~/.filebot/system.properties

Code: Select all

net.filebot.web.WebRequest.v1=true
java.net.preferIPv4Stack=true
java.net.useSystemProxies=false

:idea: You could also add this one and then do filebot --license *.psm in the Terminal and then see what the console output says:

Code: Select all

javax.net.debug=all

:?: What does filebot -script fn:sysinfo say, or does that also fail with that SSL network error?

Code: Select all

filebot -script fn:sysinfo
:idea: Please read the FAQ and How to Request Help.
droffsite
Posts: 4
Joined: 09 Jun 2023, 16:13

Re: Remote host terminated the handshake when attempting to activate license

Post by droffsite »

Custom ~/.filebot/system.properties, double-click license:

Code: Select all

Jun 09, 2023 2:01:39 PM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://app.filebot.net/update.xml: Network Connection Error: Bad file descriptor
Jun 09, 2023 2:01:39 PM net.filebot.Main onStart
WARNING: Failed to check for updates: Network Connection Error: Bad file descriptor
java.net.SocketException: Bad file descriptor
	at net.filebot.web.WebRequest.notModified(Unknown Source)
	at net.filebot.web.WebRequest.checkErrorCode(Unknown Source)
	at net.filebot.web.WebRequest.httpGetV1(Unknown Source)
	at net.filebot.web.WebRequest.fetch(Unknown Source)
	at net.filebot.CachedResource.lambda$fetchIfModified$13(Unknown Source)
	at net.filebot.CachedResource.lambda$get$0(Unknown Source)
	at net.filebot.CachedResource.retry(Unknown Source)
	at net.filebot.CachedResource.lambda$get$1(Unknown Source)
	at net.filebot.Cache.computeIf(Unknown Source)
	at net.filebot.CachedResource.get(Unknown Source)
	at net.filebot.Main.checkUpdate(Unknown Source)
	at net.filebot.Main.onStart(Unknown Source)
	at net.filebot.Main.lambda$main$2(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)

Jun 09, 2023 2:01:49 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 14:01:49 PDT 2023]
Jun 09, 2023 2:01:49 PM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 2 seconds (2 more) => java.net.SocketException: Bad file descriptor
Jun 09, 2023 2:01:49 PM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://app.filebot.net/update.xml: Network Connection Error: Bad file descriptor
Jun 09, 2023 2:01:49 PM net.filebot.Main onStart
WARNING: Failed to check for updates: Network Connection Error: Bad file descriptor
java.net.SocketException: Bad file descriptor
	at net.filebot.web.WebRequest.notModified(Unknown Source)
	at net.filebot.web.WebRequest.checkErrorCode(Unknown Source)
	at net.filebot.web.WebRequest.httpGetV1(Unknown Source)
	at net.filebot.web.WebRequest.fetch(Unknown Source)
	at net.filebot.CachedResource.lambda$fetchIfModified$13(Unknown Source)
	at net.filebot.CachedResource.lambda$get$0(Unknown Source)
	at net.filebot.CachedResource.retry(Unknown Source)
	at net.filebot.CachedResource.lambda$get$1(Unknown Source)
	at net.filebot.Cache.computeIf(Unknown Source)
	at net.filebot.CachedResource.get(Unknown Source)
	at net.filebot.Main.checkUpdate(Unknown Source)
	at net.filebot.Main.onStart(Unknown Source)
	at net.filebot.Main.lambda$main$2(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)

Jun 09, 2023 2:01:51 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 14:01:51 PDT 2023]
Jun 09, 2023 2:01:51 PM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 8 seconds (1 more) => java.net.SocketException: Bad file descriptor
Jun 09, 2023 2:01:59 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 14:01:59 PDT 2023]
Jun 09, 2023 2:01:59 PM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://license.filebot.net/verify/P50528439: Network Connection Error: Bad file descriptor
Jun 09, 2023 2:01:59 PM net.filebot.UserInteraction configureLicense
SEVERE: Network Connection Error: Bad file descriptor
Including debug line, double-click license file (oddly fewer lines):

Code: Select all

Jun 09, 2023 2:04:22 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 14:04:22 PDT 2023]
Jun 09, 2023 2:04:22 PM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 2 seconds (2 more) => java.net.SocketException: Bad file descriptor
Jun 09, 2023 2:04:22 PM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://app.filebot.net/update.xml: Network Connection Error: Bad file descriptor
Jun 09, 2023 2:04:22 PM net.filebot.Main onStart
WARNING: Failed to check for updates: Network Connection Error: Bad file descriptor
java.net.SocketException: Bad file descriptor
	at net.filebot.web.WebRequest.notModified(Unknown Source)
	at net.filebot.web.WebRequest.checkErrorCode(Unknown Source)
	at net.filebot.web.WebRequest.httpGetV1(Unknown Source)
	at net.filebot.web.WebRequest.fetch(Unknown Source)
	at net.filebot.CachedResource.lambda$fetchIfModified$13(Unknown Source)
	at net.filebot.CachedResource.lambda$get$0(Unknown Source)
	at net.filebot.CachedResource.retry(Unknown Source)
	at net.filebot.CachedResource.lambda$get$1(Unknown Source)
	at net.filebot.Cache.computeIf(Unknown Source)
	at net.filebot.CachedResource.get(Unknown Source)
	at net.filebot.Main.checkUpdate(Unknown Source)
	at net.filebot.Main.onStart(Unknown Source)
	at net.filebot.Main.lambda$main$2(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)
	at net.filebot.util.ui.SwingUI$SwingRunnable.doInBackground(Unknown Source)

Jun 09, 2023 2:04:24 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 14:04:24 PDT 2023]
Jun 09, 2023 2:04:24 PM net.filebot.CachedResource retry
WARNING: Fetch failed: Try again in 8 seconds (1 more) => java.net.SocketException: Bad file descriptor
Jun 09, 2023 2:04:32 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [P50528439] on [Fri Jun 09 14:04:32 PDT 2023]
Jun 09, 2023 2:04:32 PM net.filebot.CachedResource lambda$get$1
SEVERE: Failed to fetch resource: https://license.filebot.net/verify/P50528439: Network Connection Error: Bad file descriptor
Jun 09, 2023 2:04:32 PM net.filebot.UserInteraction configureLicense
SEVERE: Network Connection Error: Bad file descriptor
Running the command line dumped a bunch of lines, as well as causing a prompt from Little Snitch, which I'd considered for a moment and then quickly forgotten. I disabled the network filter, double-clicked the license, immediately got a positive response, re-fetched, renamed successfully. I pulled up the Little Snitch rules and found I must've inadvertently hit deny for *.filebot.net for the application. Those pop-ups in the middle of doing things can go wrong sometimes, especially at 2 in the morning; apparently this is one of those times.

Thank you for the prompt replies. Looks like I'm sorted.

If I might be so bold, a suggestion: perhaps a test HTTP GET with rabid logging around it before the first real connection? Might save you and your users some time.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remote host terminated the handshake when attempting to activate license

Post by rednoah »

droffsite wrote: 09 Jun 2023, 21:25 If I might be so bold, a suggestion: perhaps a test HTTP GET with rabid logging around it before the first real connection? Might save you and your users some time.
I see. If you're using a firewall to interfere with network connections then that does explain the otherwise impossible. Unfortunately, FileBot cannot know that you're using Little Snitch to interfere with network connections so FileBot could not give you the "Are you using Little Snitch?" clue you would have need here. Posting a fullscreen screenshot might have given us that clue via Menu Bar items. The Remote host terminated the handshake error message makes perfect sense however, now that we know, since Little Snitch intercepts the socket connection and then immediately closes it.


Now that we know that Little Snitch causes the "Remote host terminated the handshake" error message, the next guy can just search for the error message and then have things sorted in seconds. Thanks for reporting back.


tl;dr Little Snitch (or some other firewall software) is the likely culprit if you get any of these error messages:

Error: Select all

javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake

Error: Select all

java.io.IOException: Socket is not connected

Error: Select all

Network Connection Error: Bad file descriptor



:idea: Adding javax.net.debug=all will enable additional internal HTTP debug logging that is likely printed directly to console output, and notably not the FileBot Desktop application log file, hence the instruction to do filebot --license *.psm in the Terminal so you can see console output, though in this case it probably would not have given us any additional clues since it wasn't really a HTTPS issue in the first place:
rednoah wrote: 09 Jun 2023, 20:29 You could also add this one and then do filebot --license *.psm in the Terminal and then see what the console output says:

Code: Select all

javax.net.debug=all
:idea: Please read the FAQ and How to Request Help.
Post Reply