Alter CA handling to allow for PEMs containing multiple certificates

Had an issue with authenticating a self-signed certificate that should have been verified by a provided CA file.

This fixes the issue so that CA files containing 1 or more certificates are handled correctly.