Reputation: 1
While we use HttpClient we will follow below code,
var httpClientBuilder = OkHttpClient.Builder()
var caFileInputStream = context.resources.openRawResource(R.raw.my_certificate)
// We're going to put our certificates in a Keystore
val keyStore = KeyStore.getInstance("PKCS12")
keyStore.load(caFileInputStream, "my file password".toCharArray())
val keyManagerFactory = KeyManagerFactory.getInstance("X509")
keyManagerFactory.init(keyStore, "my file password".toCharArray())
val sslContext = SSLContext.getInstance("TLS")
sslContext.init(keyManagerFactory.keyManagers, null, SecureRandom())
return httpClientBuilder
.sslSocketFactory(sslContext.socketFactory)
.build()
In the same way how can we achieve this for GDHttpClient in BBD. My requirement is to attach a SSL certificate in a post request of a API call.
Upvotes: 0
Views: 83
Reputation: 848
Custom certificates can be added to BlackBerry UEM and assigned to users using your app. These will be deployed and used automatically when making network connections using GdHttpClient. For instructions on how to configure this in BlackBerry UEM, refer to the following guide.
Managing client certificates for user accounts
Upvotes: 0