jellyfin / jellyfin-tizen

Jellyfin Samsung TV Client
https://jellyfin.org
999 stars 79 forks source link

Install Issue on Linux, Certificate Format Invalid #157

Closed 5fXs6G closed 1 year ago

5fXs6G commented 1 year ago

Hello, I was able to successfully build the jellyfin-tizen bundle on Ubuntu, put my TV into developer mode, get a Samsung certificate pair issued, and connect to the TV, however at the install command I get the following error:

user@laptop:~/Documents/jellyfin/jellyfin-tizen$ tizen install -n Jellyfin.wgt -t [device]

Transferring the package...
Transferred the package: /home/user/Documents/jellyfin/jellyfin-tizen/Jellyfin.wgt -> /home/owner/share/tmp/sdk_tools/tmp
Installing the package...
--------------------
Platform log view
--------------------
install AprZAARz4r.Jellyfin
package_path /home/owner/share/tmp/sdk_tools/tmp/Jellyfin.wgt
app_id[AprZAARz4r.Jellyfin] install start
app_id[AprZAARz4r.Jellyfin] installing[9]
app_id[AprZAARz4r.Jellyfin] installing[12]
app_id[AprZAARz4r.Jellyfin] installing[14]
app_id[AprZAARz4r.Jellyfin] installing[17]
app_id[AprZAARz4r.Jellyfin] installing[19]
app_id[AprZAARz4r.Jellyfin] installing[21]
app_id[AprZAARz4r.Jellyfin] installing[24]
app_id[AprZAARz4r.Jellyfin] installing[26]
app_id[AprZAARz4r.Jellyfin] install failed[118, -12], reason: Check certificate error : :Invalid format of certificate in signature.:<-2>
spend time for wascmd is [3998]ms
Failed to install Tizen application.
Total time: 00:00:06.394

I zip extracted the Jellyfin.wgt file and opened up author-signature.xml and signature1.xml just to see if anything was visibly wrong. Both has either a distributor or author certificate and its CA respective certificate and I was able to verify they weren't corrupt with the openssl x509 -in [cert excerpt file name] -noout -text. The only thing odd was the certs were missing the standard DER -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- but I assume this is on purpose.

After getting the same error over and over after restarting the TV and dev machine, as well as getting new certs issued and uninstalling the old ones with no success, I completely uninstalled Tizen Studio and all the remaining files including the workspace folder. After reinstalling from scratch, rebuilding, repackaging, and redeploying, I get the same error.

I've only seen this error mentioned one other time on the internet and the person said using a Tizen instead of Samsung cert fixed his problem but I think that's only for an emulator and I have the physical TV.

dmitrylyzo commented 1 year ago

Mixed certificate (Samsung author + Tizen distributor) was required for Tizen 2.x (https://github.com/jellyfin/jellyfin-tizen/issues/19#issuecomment-629816880).

FYI, when Samsung certificate is used, you need to Permit to install application (this uploads your cert to the TV).

What TV model? Tizen 4+ doesn't seem to require Samsung certificate anymore (#150).

5fXs6G commented 1 year ago

Interesting point on the mixed Samsung & Tizen certificates. Are there any steps beyond just clicking either the Tizen or Samsung button in the Certificate Manager wizzard?

So I click Permit to install application in the Device Manager and it install the certificate to the TV when the Samsung certificate is selected at the default profile in Certificate Manager. When a Tizen cert is selected as default and I click Permit to install application, it says it's the wrong one for the device.

My TV is a Samsung QN90B. TV OS has been updated to latest.

dmitrylyzo commented 1 year ago

Interesting point on the mixed Samsung & Tizen certificates. Are there any steps beyond just clicking either the Tizen or Samsung button in the Certificate Manager wizzard?

You can add/remove distributor certificates in the Certificate Manager after certificate wizard. It can also be added during the wizard (for Samsung certificate) by opening the existed one from the tizen-studio folder (I don't remember). But you don't need this because your TV is Tizen 6.5 (https://developer.samsung.com/smarttv/develop/specifications/tv-model-groups.html).

So I click Permit to install application in the Device Manager and it install the certificate to the TV when the Samsung certificate is selected at the default profile in Certificate Manager. When a Tizen cert is selected as default and I click Permit to install application, it says it's the wrong one for the device.

That's right - you don't need to permit Tizen certificate. Make sure that you are installing the app that is signed with the profile you have permit. In case of Tizen certificate you just build and install.

5fXs6G commented 1 year ago

Thank you for that background info but I still can't figure out why I consistently get the Check certificate error : :Invalid format of certificate in signature. error even when I wipe the whole dev environment (including metadata), reinstall the IDE and get and install new certs, issue and select and install new Samsung certs to the TV, completely rebuild from scratch, repackage, restart the TV, restart the dev machine, etc. with always the exact same error.

Since my TV supports the Samsung Author and Distributor certificates, those are the ones I have been using this entire time (except for one Tizen attempt that couldn't install since my TV is a newer version) and I deleted and unselected the Tizen certs. When I repackage, the output replaces the previous one so there's no chance I'm getting the packages mixed up with old certs that are not installed on the TV. Finally, I open Jellyfin.wgt and the DER cert blobs in author-signature.xml and signature1.xml are using valid formatting per the openssl x509 output.

So I can't think of anything else to try. Am I missing something?

dmitrylyzo commented 1 year ago

error even when I wipe the whole dev environment (including metadata), reinstall the IDE and get and install new certs, issue and select and install new Samsung certs to the TV, completely rebuild from scratch, repackage, restart the TV, restart the dev machine, etc.

Looks correct. Wiping data and reinstalling the IDE was unnecessary, imo.

except for one Tizen attempt that couldn't install since my TV is a newer version

So simple Tizen certificate doesn't work for you, right? I was going to remove Samsung account requirement (#139, #150). 😐

5fXs6G commented 1 year ago

So simple Tizen certificate doesn't work for you, right?

Дима, извини. I just now signed with just the Tizen cert, nothing special, and it installed 🥳🎉. I think I never actually tried installing on the Tizen cert before because I read other recent posts saying the Tizen cert was only for the emulator and not a physical TV, and it didn't work when I tried to install the Tizen cert to the TV so I never actually tried installing the app annyway.

Спасибо за помощь!