Changing SSL cert detection method to allow for auto-negotiation of SSL protocols

Fixes #6904