Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagekotlin
private fun setPolicies(service: Any, trustManagers: Array<TrustManager>, keyManagers: Array<KeyManager>) {
    val conduit: HTTPConduit = ClientProxy.getClient(service).getConduit() as HTTPConduit
    // Set the "Expect: 100-continue" header
    ClientProxy.getClient(service).requestContext.put(PROTOCOL_HEADERS, mapOf("Expect" to listOf("100-continue")))
    val httpPolicy = HTTPClientPolicy()
    httpPolicy.connectionTimeout = 36000
    // Enable "chunked encoding" support
    httpPolicy.isAllowChunking = true
    httpPolicy.receiveTimeout = 32000
    val tlsParameters = TLSClientParameters()
    tlsParameters.keyManagers = keyManagers
    tlsParameters.trustManagers = trustManagers
    conduit.tlsClientParameters = tlsParameters
    conduit.client = httpPolicy
}

...