Function: gnutls-negotiate

gnutls-negotiate is an autoloaded and byte-compiled function defined in gnutls.el.gz.

Signature

(gnutls-negotiate &rest SPEC &key PROCESS TYPE HOSTNAME PRIORITY-STRING TRUSTFILES CRLFILES KEYLIST MIN-PRIME-BITS VERIFY-FLAGS VERIFY-ERROR VERIFY-HOSTNAME-ERROR &allow-other-keys)

Documentation

Negotiate a SSL/TLS connection. Return proc. Signal gnutls-error.

Note that arguments are passed CL style, :type TYPE instead of just TYPE.

PROCESS is a process returned by open-network-stream. For the meaning of the rest of the parameters, see gnutls-boot-parameters.

Probably introduced at or before Emacs version 24.1.

Source Code

;; Defined in /usr/src/emacs/lisp/net/gnutls.el.gz
(defvar gnutls-log-level)               ; gnutls.c

(cl-defun gnutls-negotiate
    (&rest spec
           &key process type hostname priority-string
           trustfiles crlfiles keylist min-prime-bits
           verify-flags verify-error verify-hostname-error
           &allow-other-keys)
  "Negotiate a SSL/TLS connection.  Return proc.  Signal gnutls-error.

Note that arguments are passed CL style, :type TYPE instead of just TYPE.

PROCESS is a process returned by `open-network-stream'.
For the meaning of the rest of the parameters, see `gnutls-boot-parameters'."
  (let* ((type (or type 'gnutls-x509pki))
	 ;; The gnutls library doesn't understand files delivered via
	 ;; the special handlers, so ignore all files found via those.
	 (file-name-handler-alist nil)
         (params (gnutls-boot-parameters
                  :type type
                  :hostname hostname
                  :priority-string priority-string
                  :trustfiles trustfiles
                  :crlfiles crlfiles
                  :keylist keylist
                  :min-prime-bits min-prime-bits
                  :verify-flags verify-flags
                  :verify-error verify-error
                  :verify-hostname-error verify-hostname-error))
         ret)
    (gnutls-message-maybe
     (setq ret (gnutls-boot process type
                            (append (list :complete-negotiation t)
                                    params)))
     "boot: %s" params)

    (when (gnutls-errorp ret)
      ;; This is an error from the underlying C code.
      (signal 'gnutls-error (list process ret)))

    process))