Uplift from v1-fix: add a way to return a certificate chain