The quick and dirty one is to use TLS (thread local storage). Slightly more complex but more clean one: put these parameters into keys manager and pass it around as needed. Aleksey