Modern tls support

Per issue #12524.  See commit comments for details.