uplink: modularize ssl peer cert validation