*/
private CloseableHttpClient buildClient(boolean trustSelfSigned) {
try {
// if required, define custom SSL context allowing self-signed certs
SSLContext sslContext = !trustSelfSigned ? SSLContexts.createSystemDefault() : SSLContexts.custom()
.loadTrustMaterial(null, new TrustSelfSignedStrategy()).build();
// set timeouts for the HTTP client
int globalTimeout = readFromProperty("bdTimeout", 10000);
int connectTimeout = readFromProperty("bdConnectTimeout", globalTimeout);
int connectionRequestTimeout = readFromProperty("bdConnectionRequestTimeout", globalTimeout);