I was trying to customize the ciphers and protocol...
# ktor
c
I was trying to customize the ciphers and protocol before a request, but is this the correct way? Note, I am not interested to change the configuration for all requests, I need to configure before every request since I'll make multiple of them with the same client. So I am looking for a way to customize the supported ciphers before every request, I tried this solution but it doesn't seem to work.
Copy code
(client.engine.config as ApacheEngineConfig).customizeClient {
    setSSLStrategy(SSLIOSessionStrategy(
            defaultSslContext,
            listOf("TLSv1.2", "TLSv1.3").toTypedArray(),
            listOf(
                    "TLS_AES_128_GCM_SHA256",
                    "TLS_AES_256_GCM_SHA384",
                    "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
                    "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
                    "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
                    "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
                    "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
                    "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
                    "TLS_RSA_WITH_AES_128_GCM_SHA256",
                    "TLS_RSA_WITH_AES_256_GCM_SHA384",
                    "TLS_RSA_WITH_AES_128_CBC_SHA",
                    "TLS_RSA_WITH_AES_256_CBC_SHA"
            ).toTypedArray(),
            NoopHostnameVerifier.INSTANCE
    ))
}
a
I don't think you can configure that for individual requests although you can have a separate preconfigured client with customized ciphers.
c
Yes my current solution is to create an whole client per request, but that's a bit intensive..., was looking for something to interchange SSL ciphers for each request without re-instantiate a whole client again and again