Add xmlSecProxyCtx and refactor custumized code