add support for certificate chains, refs #174