tls: introduce asynchronous `newSession`

fix #7105
Merge remote-tracking branch 'upstream/master'