support for certificate chains

this is already done in later versions of mongoose, but the one bundled
here didn't quite support certificate chains yet and would only present
the first one in the .pem file