Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Problems setting serverCertificate via swift #222

Open
chadacious opened this issue Jan 22, 2022 · 1 comment
Open

Problems setting serverCertificate via swift #222

chadacious opened this issue Jan 22, 2022 · 1 comment

Comments

@chadacious
Copy link

chadacious commented Jan 22, 2022

I'm trying to take a base64 encoded string, convert it to Data and set the serverCertificate:

let TEST_SERVER_CERT = [base64EncodedString]
let serverCert = Data.init(base64Encoded: TEST_SERVER_CERT)
player.configure("drm.advanced.com\\.widevine\\.alpha.serverCertificate", with: serverCert!)

I get back [Error]: "Invalid config, wrong type for .drm.advanced.com.widevine.alpha.serverCertificate"

Will keep trying variations and start debugging but thought I would reach out for help in case someone knows what's up.

@chadacious
Copy link
Author

chadacious commented Jan 22, 2022

Tried the same thing from Objective C and got the same error:

NSString *base64Encoded = @"[base64EncodedString]";
NSData *serverCert = [[NSData alloc] initWithBase64EncodedString:base64Encoded options:0];
[player configure:@"drm.advanced.com\\.widevine\\.alpha.serverCertificate"
         withData:serverCert];

[Error]: "Invalid config, wrong type for .drm.advanced.com.widevine.alpha.serverCertificate"

Remembering what I saw when debugging, I believe in the javascript it looked like the certificate data type is coming in as a ByteArray instead of a typed Uint8Array so it is failing the type check.

For now, I just modified the compile shaka js code to force set the server certificate for testing and dev purposes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant