Am 05.02.2018 um 11:18 schrieb Artem Borisovskiy:

This method only accepts plain functions and makes it impossible to customize paths in runtime. Am I missing something? Looks like a completely unnecessary restriction, which forces me to go off-track just to find a workaround. Theoretically, I could use global variables if the paths were unconditional, but I need to choose them based on a runtime parameter. So I have to use TLS globals and create a separate custom thread for each TLS connection just to pass these paths to a callback indirectly via globals. Looks like a huge hack for such a simple task.

You are right, this is currently an unnecessary restriction and I
actually ran into this myself recently. The easiest fix would be to add
a void delegate(TLSContext) tlsSetupCallback field to
HTTPClientSettings and to prefer that over the global one. I'll open a
pull request for that.

The global one was just added as a way to control basic certificate
validation when using the global requestHTTP functions and a
per-client solution was skipped at the time.