Reverted to old version of certificate chain handling