Following discussion on emacs-devel on how to do this, latest version of patch attached. This maintains backwards compatibility for open-gnutls-stream (assuming I haven't screwed up the checks), and updates the relevant documentation.