Proxy configuration

How to use

For the SDK to use your proxy to make requests, you must enter the settings to be used through an instance of the ProxySettings class sent as a parameter to the setProxySettings method in the builder of any of our SDKs:

ProxySettings proxySettings = new ProxySettings(hostname, port)
    .setAuthentication(user, password); // This call is not mandatory, see documentation below

DeviceAuthenticator mDeviceAuthenticator = new DeviceAuthenticator.Builder(mobileToken)
    .setProxySettings(proxySettings)
    .build();

Constructor method

ParameterTypeDescription

hostname

String

Sets the domain or IP address of the proxy service.

port

int

Sets the port to be used.

Optional methods

setAuthentication(String user, String password)

Tells you the authentication parameters of your proxy if any.

ParameterDescription

user

Username to be used for authentication.

password

Password to be used for authentication.

setProxyCertificate(@RawRes Integer proxyCertificate)

If your proxy server uses a self-signed SSL certificate or one issued by a non-public Certification Authority (CA), add the CA certificate in PEM or DER format to res/raw/ (e.g.res/raw/proxy_certificate) and pass as argument the file identifier (e.g.R.raw.proxy_certificate).

ParameterTypeDescription

proxyCertificate

int

ID of the proxy certificate file.

setMTLSConfig(@RawRes Integer clientCertificate, String password)

If your proxy server supports mTLS, save the certificate to be used by the client in PKCS12 format (.p12) in res/raw/ (e.g. res/raw/client_certificate) and pass the file identifier (e.g. R.raw.client_certificate) and the private key as an argument.

ParameterTypeDescription

clientCertificate

int

ID of the certificate file to be used by the client.

password

String

Private key to be used by the customer.

Last updated

Logo

2023 © Caf. - All rights reserved