FrogTheFrog / moondeck

A plugin that makes it easier to manage your gamestream sessions from the SteamDeck.
GNU General Public License v3.0
128 stars 7 forks source link

SSL Verification Failed #25

Closed Klausmensch closed 1 year ago

Klausmensch commented 1 year ago

Using the latest Versions of Sunshine, MoonDeck and MoonDeck Buddy, MoonDeck Plugin on Steam Deck shows Buddy Status: Ssl Verification Failed. Playing via Moonlight works fine though.

FrogTheFrog commented 1 year ago

Please post a /tmp/moondeck.log from SteamDeck.

Klausmensch commented 1 year ago

2023-04-13 21:06:52,364 INFO -> get_usersettings(args=(<class '.Plugin'>,)) 2023-04-13 21:06:52,365 INFO <- get_user_settings(...): {'version': 10, 'clientId': 'XXXXXXXXXXXXX', 'currentHostId': None, 'gameSession': {'autoApplyAppId': False, 'resumeAfterSuspend': False}, 'buttonPosition': {'horizontalAlignment': 'bottom', 'verticalAlignment': 'right', 'offsetX': '', 'offsetY': '', 'offsetForHltb': False}, 'buttonStyle': {'showFocusRing': True, 'theme': 'HighContrast'}, 'hostSettings': {}} 2023-04-13 21:10:16,420 INFO -> scan_forhosts(args=(<class '.Plugin'>,), kwargs={'timeout': 5}) 2023-04-13 21:10:21,428 INFO <- scan_for_hosts(...): [{'address': '192.168.178.34', 'hostName': 'XXXXXXXXX', 'mac': 'XXXXXXXXXXXX', 'uniqueId': 'XXXXXXXXXXX'}] 2023-04-13 21:10:22,514 INFO -> set_usersettings(args=(<class '.Plugin'>,), kwargs={'data': {'version': 10, 'clientId': 'XXXXXXXXXXXXXXXX', 'currentHostId': 'XXXXXXXXXXXXXX, 'gameSession': {'autoApplyAppId': False, 'resumeAfterSuspend': False}, 'buttonPosition': {'horizontalAlignment': 'bottom', 'verticalAlignment': 'right', 'offsetX': '', 'offsetY': '', 'offsetForHltb': False}, 'buttonStyle': {'showFocusRing': True, 'theme': 'HighContrast'}, 'hostSettings': {'95B7A3BE-99E2-A121-649E-62F58C89BDC2': {'buddyPort': 59999, 'address': '192.168.178.34', 'staticAddress': False, 'hostName': 'XXXXXXXX', 'mac': 'XXXXXXXXX', 'closeSteamOnceSessionEnds': False, 'resolution': {'automatic': True, 'appResolutionOverride': 'CustomResolution', 'passToBuddy': True, 'passToMoonlight': True, 'useCustomDimensions': False, 'selectedDimensionIndex': -1, 'defaultBitrate': None, 'dimensions': []}, 'hostApp': {'selectedAppIndex': -1, 'apps': []}}}}}) 2023-04-13 21:10:22,516 INFO <- set_user_settings(...): None 2023-04-13 21:10:22,518 INFO -> get_buddystatus(args=(<class '.Plugin'>,), kwargs={'address': '192.168.178.34', 'buddy_port': 59999, 'client_id': 'XXXXXXXXXXXXXX', 'timeout': 1}) 2023-04-13 21:10:22,752 INFO <- get_buddy_status(...): SslVerificationFailed 2023-04-13 21:10:26,039 INFO -> get_buddystatus(args=(<class '.Plugin'>,), kwargs={'address': '192.168.178.34', 'buddy_port': 59999, 'client_id': 'XXXXXXXXXXXX', 'timeout': 1}) 2023-04-13 21:10:26,269 INFO <- get_buddy_status(...): SslVerificationFailed 2023-04-13 21:10:26,271 INFO -> findhost(args=(<class '.Plugin'>,), kwargs={'host_id': 'XXXXXXXXXXXX', 'timeout': 1}) 2023-04-13 21:10:26,384 INFO <- find_host(...): {'address': '192.168.178.34', 'hostName': 'XXXXXX', 'mac': 'XXXXXXXXXX', 'uniqueId': 'XXXXXXXXXXXX'} 2023-04-13 21:10:32,218 INFO -> findhost(args=(<class '.Plugin'>,), kwargs={'host_id': 'XXXXXXXXXXXXXXXX', 'timeout': 1}) 2023-04-13 21:10:32,323 INFO <- find_host(...): {'address': '192.168.178.34', 'hostName': 'XXXXXXXX', 'mac': 'XXXXXXXX', 'uniqueId': 'XXXXXXXXXXXXX'} 2023-04-13 21:10:32,325 INFO -> get_buddystatus(args=(<class '.Plugin'>,), kwargs={'address': '192.168.178.34', 'buddy_port': 59999, 'client_id': 'XXXXXXXXXXXXXX', 'timeout': 1}) 2023-04-13 21:10:32,560 INFO <- get_buddy_status(...): SslVerificationFailed

FrogTheFrog commented 1 year ago

Please also post a moondeckbuddy.log from host PC after you enable the debug logs for it (check the wiki - condifugration) on how to do it.

Klausmensch commented 1 year ago

changed settings.json to the following using Notepad. Not sure if I did it right:

{ "handled_displays": [ ], "logging_rules": "buddy.*.debug=true", "nvidia_reset_mouse_acceleration_after_stream_end_hack": false, "port": 59999, "sunshine_apps_filepath": "" }

Did a reboot and tried to connect via moondeck and also tried to launch a game with the moondeck button. this is the log of moondeckbuddy.log:

[21:36:01.745] INFO buddy.utils: Log location: "C:/ProgramData/Programs/MoonDeckBuddy/bin/moondeckbuddy.log" [21:36:01.746] INFO buddy.main: startup. [21:36:02.116] INFO buddy.server: Server started listening at port 59999 [21:36:02.116] INFO buddy.main: startup finished. [21:36:02.117] DEBUG buddy.os: Steam exec path: "c:/program files (x86)/steam/steam.exe" [21:36:23.204] DEBUG buddy.os: Steam is running! [21:36:23.205] DEBUG buddy.os: Handling Steam start.

edit: did another restart, new log:

[21:59:06.837] INFO buddy.utils: Log location: "C:/ProgramData/Programs/MoonDeckBuddy/bin/moondeckbuddy.log" [21:59:06.837] INFO buddy.main: startup. [21:59:06.977] INFO buddy.server: Server started listening at port 59999 [21:59:06.977] INFO buddy.main: startup finished. [21:59:06.978] DEBUG buddy.os: Steam exec path: "c:/program files (x86)/steam/steam.exe" [21:59:06.981] DEBUG buddy.os: Failed to start monitoring Steam process 15992 (probably outdated)...

Klausmensch commented 1 year ago

Btw, I had the same status message with all previous versions of moondeck and buddy I installed. Maybe that helps. Thank you for your work :)

FrogTheFrog commented 1 year ago

Yeah, unfortunately I don't really have any advice regarding these errors, the logs look as expected...

Can you go to ~/homebrew/plugins/moondeck/python/lib/logger.py and change the logging.INFO to logging.DEBUG? Then restart the SteamDeck and check the /tmp/moondeck.log again, maybe it will provide some useful info?

Also try opening https://192.168.178.34:59999/ and verify that MoonDeckBuddy is using the SSL certificate: image

Finally, this might be stupid, but update MS redistributables as recommended by the Setup page in wiki. It has resolved some different issues in the past.

Klausmensch commented 1 year ago

When I try to open https://192.168.178.34:59999/ in my browser, this is what I get:

ERR_SSL_VERSION_OR_CIPHER_MISMATCH

FrogTheFrog commented 1 year ago

Make sure the TLS 1.3 is enabled in Windows: image

(from https://www.hostinger.com/tutorials/ssl-version-cipher-mismatch-error)

Klausmensch commented 1 year ago

Sadly, that didn't do the trick. It wasn't enabled though. I'll change the logging.INFO to logging.DEBUG tomorrow and post the results. Thanks for your support so far!

timbyr commented 1 year ago

I think I've hit the same issue.

The ssl directory under /home/deck/homebrew/plugins/moondeck/python/ssl does not have the content from https://github.com/FrogTheFrog/moondeck-keys. This is causing an SSL error when trying to open the moondeck_cert.pem at https://github.com/FrogTheFrog/moondeck/blob/492995e6489fb38ca8b3a5df64683cad9834f877/defaults/python/lib/buddyrequests.py#L77

I was able to fix by copying the files from the moondeck-keys repo to the ssl folder on my Deck.

At a guess the packaging for the last version of the module didn't check out the submodule, so fresh installs don't have the files.

FrogTheFrog commented 1 year ago

I think I've hit the same issue.

The ssl directory under /home/deck/homebrew/plugins/moondeck/python/ssl does not have the content from https://github.com/FrogTheFrog/moondeck-keys. This is causing an SSL error when trying to open the moondeck_cert.pem at

https://github.com/FrogTheFrog/moondeck/blob/492995e6489fb38ca8b3a5df64683cad9834f877/defaults/python/lib/buddyrequests.py#L77

I was able to fix by copying the files from the moondeck-keys repo to the ssl folder on my Deck.

At a guess the packaging for the last version of the module didn't check out the submodule, so fresh installs don't have the files.

It's a different issue (or should be, as you should see the Exception status) and it was supposed to be already resolved :/. Can you please try switching between testing store version and then back to stable store version? I wonder if some cache is outdated or something.

Klausmensch commented 1 year ago

Updated all Restributables - didn't help.

The new log after I changed logging.INFO to logging.DEBUG:

2023-04-16 16:19:46,535 INFO -> get_usersettings(args=(<class '.Plugin'>,)) 2023-04-16 16:19:46,537 INFO <- get_user_settings(...): {'version': 10, 'clientId': 'XXXXXXXXXX', 'currentHostId': 'XXXXXXXXXX', 'gameSession': {'autoApplyAppId': False, 'resumeAfterSuspend': False}, 'buttonPosition': {'horizontalAlignment': 'bottom', 'verticalAlignment': 'right', 'offsetX': '', 'offsetY': '', 'offsetForHltb': False}, 'buttonStyle': {'showFocusRing': True, 'theme': 'HighContrast'}, 'hostSettings': {'XXXXXXXXXX': {'buddyPort': 59999, 'address': '192.168.178.34', 'staticAddress': False, 'hostName': 'XXXXXXXXXX', 'mac': 'XXXXXXXXXX', 'closeSteamOnceSessionEnds': False, 'resolution': {'automatic': True, 'appResolutionOverride': 'CustomResolution', 'passToBuddy': True, 'passToMoonlight': True, 'useCustomDimensions': False, 'selectedDimensionIndex': -1, 'defaultBitrate': None, 'dimensions': []}, 'hostApp': {'selectedAppIndex': -1, 'apps': []}}}} 2023-04-16 16:19:46,725 INFO -> get_buddystatus(args=(<class '.Plugin'>,), kwargs={'address': '192.168.178.34', 'buddy_port': 59999, 'client_id': 'XXXXXXXXXX', 'timeout': 1}) 2023-04-16 16:19:46,849 DEBUG Request failed: SSL Verification: Cannot connect to host 192.168.178.34:59999 ssl:default [[SSL: BAD_PROTOCOL_VERSION_NUMBER] bad protocol version number (_ssl.c:997)] 2023-04-16 16:19:46,849 INFO <- get_buddy_status(...): SslVerificationFailed 2023-04-16 16:19:46,850 INFO -> findhost(args=(<class '.Plugin'>,), kwargs={'host_id': 'XXXXXXXXXX', 'timeout': 1}) 2023-04-16 16:19:46,934 INFO <- find_host(...): {'address': '192.168.178.34', 'hostName': 'XXXXXXXXXX', 'mac': 'XXXXXXXXXX', 'uniqueId': 'XXXXXXXXXX'} 2023-04-16 16:20:42,634 INFO -> get_moondeckrunpath(args=(<class '.Plugin'>,)) 2023-04-16 16:20:42,634 INFO <- get_moondeckrun_path(...): /home/deck/homebrew/plugins/moondeck/python/moondeckrun.sh 2023-04-16 16:20:43,066 INFO -> get_runnerresult(args=(<class '.Plugin'>,)) 2023-04-16 16:20:43,067 INFO <- get_runner_result(...): None 2023-04-16 16:20:44,768 INFO -> is_runneractive(args=(<class '.Plugin'>,), kwargs={'app_id': 2224230268}) 2023-04-16 16:20:44,790 INFO <- is_runner_active(...): False 2023-04-16 16:20:44,797 INFO -> get_runnerresult(args=(<class '.Plugin'>,)) 2023-04-16 16:20:44,798 INFO <- get_runner_result(...): SSL certificate could not be verified!

FrogTheFrog commented 1 year ago

Ok, so the issue is with the host PC. Can you please enable all of the debug logs for Buddy? Use "*.debug=true".

Then restart, make sure MoonDeck tries to connect and post the log. Please use "```" around your content to produce a code block.

FrogTheFrog commented 1 year ago

Closing due to inactivity, please reopen if needed.

FrogTheFrog commented 1 year ago

@Klausmensch it is possible to downgrade SSL version to 1.2 with the latest Buddy release. If you're still up for it, please try it out.