Skip Navigation

Limitations for OkHttp Support

The OkHttp API is currently available as a beta feature release that is subject to further testing and changes.
Support for OkHttp API as a beta feature is new in the 10.1 release of
BlackBerry Dynamics SDK
. The following table outlines limitations in the initial release:
Limitation
Description
Get, set, and clear cookies
Cookies are supported and are always stored in the secure container, however, there are currently no methods to get, set, or clear them.
Caching
Caching is not supported in this release.
Proxy
Proxy servers are supported, but there is no API to set a proxy. It will work if proxies are set in
UEM
, either using a PAC file or manually. If proxy authentication is required, this will be done automatically as is the case for the existing HttpClient API. Otherwise, a 407 HTTP status will be returned.
Authentication
  • Basic authentication will work if an authentication interceptor is used and included before the BBCustomInterceptor when building the OkHttpClient. Use of OkHttp authenticators is not supported, and is unlikely to be supported due to constraints imposed by OkHttp. See the following for a simple example of such an interceptor:
    public class ReactiveBasicAuthInterceptor : Interceptor { val credentials = Credentials.basic("username", "password") @NotNull override public fun intercept(chain: Chain): Response { val request = chain.request() val response = chain.proceed(request) return if (response.code == 401) chain.proceed( request.newBuilder().header("Authorization", credentials).build() ) else response } }
  • NTLM authentication may similarly be supported by third-party authentication interceptors.
  • Kerberos
    authentication using PKINIT or KCD is supported, but
    Kerberos
    using user-supplied credentials is not supported.
  • SPNEGO is not supported.
Timeouts
Timeouts in OkHttp are separated into connection timeouts, read timeouts, and write timeouts.
BlackBerry Dynamics
OkHttp only supports connection timeouts, and it is not currently possible to change the timeout value.
Certificates
It is not currently possible to disable HTTPS host/peer certificate verification, or to enforce pinned certificates.