Disabling SSL verification
By default, before playing a stream that is being served over HTTPS, the OpenTV Player does the following SSL verification checks:
- Verify the host (
CURL_VERIFY_HOST
). - Verify the peer (
CURL_VERIFY_PEER
). - Check that the TLS version being used is 1.2 or above.
The verification stage can be disabled if required using the NMPSDK.disableSSLVerification()
API. For example, if there is a problem with the certificate, you could decide to disable verification so that playback can proceed to avoid negatively impacting the user experience.
Prerequisites
If custom certificates are used, they must be added to the default AndroidCAStore
before calling NMPSDK.load()
to create the SDK.
Example code
SSL verification is disabled by calling NMPSDK.disableSSLVerification()
after NMPSDK.load()
is called, and before playback has started:
boolean NMPSDK.disableSSLVerification()
This returns:
true
if SSL verification was successfully disabled.false
if SSL verification could not be disabled because playback has already started.
Once this has been called:
- HTTPS playback is allowed – the data will be decrypted but SSL verification will not be performed.
- SSL verification will remain disabled for the lifetime of the
NMPSDK
.