Not for this PR but we should revisit this authentication function at some point. We shouldn't need to copy the whole trust store for every API call. Instead we should look at the peer certificates any retrieve exactly one matching certificate by fingerprint, then perform the full byte-for-byte comparison.
Originally posted by @markylaing in #590
Originally posted by @markylaing in #590