server: support secure mode too