various problems including sporadic IPSec authentification failures if this code is used by multiple instances in parallel.