2012-04-09 13:10:22 +00:00
|
|
|
\input texinfo @c -*-texinfo-*-
|
|
|
|
|
2013-01-05 16:19:53 +00:00
|
|
|
@set VERSION 0.3
|
|
|
|
|
2014-06-10 02:20:31 +00:00
|
|
|
@setfilename ../../info/emacs-gnutls.info
|
2012-04-09 13:10:22 +00:00
|
|
|
@settitle Emacs GnuTLS Integration @value{VERSION}
|
Fix single-quoting style in PDF manuals
The PDF versions of the GNU manuals used curved single quotes to
represent grave accent and apostrophe, which made it a pain to cut
and paste code examples from them. Fix the PDF versions to use
grave accent and apostrophe for Lisp source code, keystrokes, etc.
This change does not affect the info files, nor does it affect
ordinary uses of curved single quotes in PDF.
* doc/emacs/docstyle.texi: New file, which specifies treatment for
grave accent and apostrophe, as well as the document encoding.
* doc/emacs/emacs-xtra.texi, doc/emacs/emacs.texi:
* doc/lispintro/emacs-lisp-intro.texi:
* doc/lispref/back.texi, doc/lispref/book-spine.texi:
* doc/lispref/elisp.texi, doc/lispref/lay-flat.texi:
* doc/misc/ada-mode.texi, doc/misc/auth.texi:
* doc/misc/autotype.texi, doc/misc/bovine.texi, doc/misc/calc.texi:
* doc/misc/cc-mode.texi, doc/misc/cl.texi, doc/misc/dbus.texi:
* doc/misc/dired-x.texi, doc/misc/ebrowse.texi, doc/misc/ede.texi:
* doc/misc/ediff.texi, doc/misc/edt.texi, doc/misc/efaq-w32.texi:
* doc/misc/efaq.texi, doc/misc/eieio.texi, doc/misc/emacs-gnutls.texi:
* doc/misc/emacs-mime.texi, doc/misc/epa.texi, doc/misc/erc.texi:
* doc/misc/ert.texi, doc/misc/eshell.texi, doc/misc/eudc.texi:
* doc/misc/eww.texi, doc/misc/flymake.texi, doc/misc/forms.texi:
* doc/misc/gnus-coding.texi, doc/misc/gnus-faq.texi:
* doc/misc/gnus.texi, doc/misc/htmlfontify.texi:
* doc/misc/idlwave.texi, doc/misc/ido.texi, doc/misc/info.texi:
* doc/misc/mairix-el.texi, doc/misc/message.texi, doc/misc/mh-e.texi:
* doc/misc/newsticker.texi, doc/misc/nxml-mode.texi:
* doc/misc/octave-mode.texi, doc/misc/org.texi, doc/misc/pcl-cvs.texi:
* doc/misc/pgg.texi, doc/misc/rcirc.texi, doc/misc/reftex.texi:
* doc/misc/remember.texi, doc/misc/sasl.texi, doc/misc/sc.texi:
* doc/misc/semantic.texi, doc/misc/ses.texi, doc/misc/sieve.texi:
* doc/misc/smtpmail.texi, doc/misc/speedbar.texi:
* doc/misc/srecode.texi, doc/misc/todo-mode.texi, doc/misc/tramp.texi:
* doc/misc/url.texi, doc/misc/vhdl-mode.texi, doc/misc/vip.texi:
* doc/misc/viper.texi, doc/misc/widget.texi, doc/misc/wisent.texi:
* doc/misc/woman.texi:
Use it instead of '@documentencoding UTF-8', to lessen the need for
global changes like this in the future.
* doc/emacs/Makefile.in (EMACS_XTRA):
* doc/lispintro/Makefile.in (srcs):
* doc/lispref/Makefile.in (srcs):
Add dependency on docstyle.texi.
* doc/misc/Makefile.in (style): New macro.
(${buildinfodir}/%.info, %.dvi, %.pdf, %.html)
(${buildinfodir}/ccmode.info, ${buildinfodir}/efaq%.info, gnus_deps):
Use it.
2015-05-01 19:05:53 +00:00
|
|
|
@include docstyle.texi
|
2012-04-09 13:10:22 +00:00
|
|
|
|
|
|
|
@copying
|
|
|
|
This file describes the Emacs GnuTLS integration.
|
|
|
|
|
2016-01-01 09:38:07 +00:00
|
|
|
Copyright @copyright{} 2012--2016 Free Software Foundation, Inc.
|
2012-04-09 13:10:22 +00:00
|
|
|
|
|
|
|
@quotation
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
|
|
|
any later version published by the Free Software Foundation; with no
|
2014-05-07 17:34:53 +00:00
|
|
|
Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
|
2012-04-09 13:10:22 +00:00
|
|
|
and with the Back-Cover Texts as in (a) below. A copy of the license
|
2012-12-21 19:01:24 +00:00
|
|
|
is included in the section entitled ``GNU Free Documentation License''.
|
2012-04-09 13:10:22 +00:00
|
|
|
|
|
|
|
(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
|
2012-12-21 18:36:41 +00:00
|
|
|
modify this GNU manual.''
|
2012-04-09 13:10:22 +00:00
|
|
|
@end quotation
|
|
|
|
@end copying
|
|
|
|
|
2012-05-02 07:33:52 +00:00
|
|
|
@dircategory Emacs network features
|
2012-04-09 13:10:22 +00:00
|
|
|
@direntry
|
2013-09-08 23:31:14 +00:00
|
|
|
* Emacs GnuTLS: (emacs-gnutls). The Emacs GnuTLS integration.
|
2012-04-09 13:10:22 +00:00
|
|
|
@end direntry
|
|
|
|
|
|
|
|
@titlepage
|
|
|
|
@title Emacs GnuTLS Integration
|
|
|
|
@author by Ted Zlatanov
|
|
|
|
@page
|
|
|
|
@vskip 0pt plus 1filll
|
|
|
|
@insertcopying
|
|
|
|
@end titlepage
|
|
|
|
|
|
|
|
@contents
|
|
|
|
|
|
|
|
@ifnottex
|
|
|
|
@node Top
|
|
|
|
@top Emacs GnuTLS
|
|
|
|
This manual describes the Emacs GnuTLS integration.
|
|
|
|
|
|
|
|
GnuTLS is a library that establishes encrypted @acronym{SSL} or
|
|
|
|
@acronym{TLS} connections. Emacs supports it through the
|
|
|
|
@file{gnutls.c} and @file{gnutls.h} C files and the @file{gnutls.el}
|
|
|
|
Emacs Lisp library.
|
|
|
|
|
|
|
|
@insertcopying
|
|
|
|
|
|
|
|
@menu
|
|
|
|
* Overview:: Overview of the GnuTLS integration.
|
|
|
|
* Help For Users::
|
|
|
|
* Help For Developers::
|
2012-12-21 19:01:24 +00:00
|
|
|
* GNU Free Documentation License:: The license for this documentation.
|
2012-04-09 13:10:22 +00:00
|
|
|
* Function Index::
|
|
|
|
* Variable Index::
|
|
|
|
@end menu
|
|
|
|
@end ifnottex
|
|
|
|
|
|
|
|
@node Overview
|
|
|
|
@chapter Overview
|
|
|
|
|
|
|
|
The GnuTLS library is an optional add-on for Emacs. Through it, any
|
|
|
|
Emacs Lisp program can establish encrypted network connections that
|
|
|
|
use @dfn{Secure Socket Layer} (@acronym{SSL}) and @dfn{Transport Layer
|
|
|
|
Security} (@acronym{TLS}) protocols. The process of using
|
|
|
|
@acronym{SSL} and @acronym{TLS} in establishing connections is as
|
|
|
|
automated and transparent as possible.
|
|
|
|
|
|
|
|
The user has only a few customization options currently: the log
|
|
|
|
level, priority string, trustfile list, and the minimum number of bits
|
|
|
|
to be used in Diffie-Hellman key exchange. Rumors that every Emacs
|
|
|
|
library requires at least 83 customizable variables are thus proven
|
|
|
|
false.
|
|
|
|
|
|
|
|
@node Help For Users
|
|
|
|
@chapter Help For Users
|
|
|
|
|
|
|
|
From the user's perspective, there's nothing to the GnuTLS
|
|
|
|
integration. It Just Works for any Emacs Lisp code that uses
|
|
|
|
@code{open-protocol-stream} or @code{open-network-stream}
|
|
|
|
(@pxref{Network,, Network Connections, elisp, The Emacs Lisp Reference
|
|
|
|
Manual}). The two functions are equivalent, the first one being an
|
|
|
|
alias of the second.
|
|
|
|
|
|
|
|
There's one way to find out if GnuTLS is available, by calling
|
|
|
|
@code{gnutls-available-p}. This is a little bit trickier on the W32
|
|
|
|
(Windows) platform, but if you have the GnuTLS DLLs (available from
|
|
|
|
@url{http://sourceforge.net/projects/ezwinports/files/} thanks to Eli
|
|
|
|
Zaretskii) in the same directory as Emacs, you should be OK.
|
|
|
|
|
|
|
|
@defun gnutls-available-p
|
2014-06-08 23:39:23 +00:00
|
|
|
This function returns @code{t} if GnuTLS is available in this instance of Emacs.
|
2012-04-09 13:10:22 +00:00
|
|
|
@end defun
|
|
|
|
|
|
|
|
Oh, but sometimes things go wrong. Budgets aren't balanced,
|
|
|
|
television ads lie, and even TLS and SSL connections can fail to work
|
|
|
|
properly. Well, there's something to be done in the last case.
|
|
|
|
|
|
|
|
@defvar gnutls-log-level
|
|
|
|
The @code{gnutls-log-level} variable sets the log level. 1 is
|
|
|
|
verbose. 2 is very verbose. 5 is crazy. Crazy! Set it to 1 or 2
|
Use @file for buffers, per the Texinfo manual
* doc/misc/ada-mode.texi, doc/misc/auth.texi, doc/misc/calc.texi:
* doc/misc/ebrowse.texi, doc/misc/efaq.texi, doc/misc/emacs-gnutls.texi:
* doc/misc/epa.texi, doc/misc/ert.texi, doc/misc/eshell.texi:
* doc/misc/eww.texi, doc/misc/flymake.texi, doc/misc/gnus.texi:
* doc/misc/info.texi, doc/misc/message.texi, doc/misc/mh-e.texi:
* doc/misc/newsticker.texi, doc/misc/pcl-cvs.texi, doc/misc/rcirc.texi:
* doc/misc/sem-user.texi, doc/misc/smtpmail.texi, doc/misc/url.texi:
* doc/misc/viper.texi, doc/misc/wisent.texi, doc/misc/woman.texi:
Use @file for buffers, per the Texinfo manual.
2014-03-12 20:52:34 +00:00
|
|
|
and look in the @file{*Messages*} buffer for the debugging
|
2012-04-09 13:10:22 +00:00
|
|
|
information.
|
|
|
|
@end defvar
|
|
|
|
|
|
|
|
@defvar gnutls-algorithm-priority
|
|
|
|
The @code{gnutls-algorithm-priority} variable sets the GnuTLS priority
|
|
|
|
string. This is global, not per host name (although
|
|
|
|
@code{gnutls-negotiate} supports a priority string per connection so
|
|
|
|
it could be done if needed). The priority string syntax is in the
|
|
|
|
@uref{http://www.gnu.org/software/gnutls/documentation.html, GnuTLS
|
|
|
|
documentation}.
|
|
|
|
@end defvar
|
|
|
|
|
|
|
|
@defvar gnutls-trustfiles
|
|
|
|
The @code{gnutls-trustfiles} variable is a list of trustfiles
|
|
|
|
(certificates for the issuing authorities). This is global, not per
|
|
|
|
host name (although @code{gnutls-negotiate} supports a trustfile per
|
|
|
|
connection so it could be done if needed). The trustfiles can be in
|
|
|
|
PEM or DER format and examples can be found in most Unix
|
2015-12-24 17:54:41 +00:00
|
|
|
distributions. By default the following locations are tried in this
|
|
|
|
order: @file{/etc/ssl/certs/ca-certificates.crt} for Debian, Ubuntu,
|
|
|
|
Gentoo and Arch Linux; @file{/etc/pki/tls/certs/ca-bundle.crt} for
|
|
|
|
Fedora and RHEL; @file{/etc/ssl/ca-bundle.pem} for Suse;
|
|
|
|
@file{/usr/ssl/certs/ca-bundle.crt} for Cygwin;
|
|
|
|
@file{/usr/local/share/certs/ca-root-nss.crt} for FreeBSD. You can
|
|
|
|
easily customize @code{gnutls-trustfiles} to be something else, but
|
|
|
|
let us know if you do, so we can make the change to benefit the other
|
|
|
|
users of that platform.
|
2012-04-09 13:10:22 +00:00
|
|
|
@end defvar
|
|
|
|
|
2013-12-23 12:50:47 +00:00
|
|
|
@defvar gnutls-verify-error
|
|
|
|
The @code{gnutls-verify-error} variable allows you to verify SSL/TLS
|
|
|
|
server certificates for all connections or by host name. It defaults
|
|
|
|
to @code{nil} for now but will likely be changed to @code{t} later,
|
|
|
|
meaning that all certificates will be verified.
|
|
|
|
|
|
|
|
There are two checks available currently, that the certificate has
|
|
|
|
been issued by a trusted authority as defined by
|
|
|
|
@code{gnutls-trustfiles}, and that the hostname matches the
|
|
|
|
certificate. @code{t} enables both checks, but you can enable them
|
|
|
|
individually as well with @code{:trustfiles} and @code{:hostname}
|
|
|
|
instead.
|
|
|
|
|
|
|
|
Because of the low-level interactions with the GnuTLS library, there
|
|
|
|
is no way currently to ask if a certificate can be accepted. You have
|
Use @file for buffers, per the Texinfo manual
* doc/misc/ada-mode.texi, doc/misc/auth.texi, doc/misc/calc.texi:
* doc/misc/ebrowse.texi, doc/misc/efaq.texi, doc/misc/emacs-gnutls.texi:
* doc/misc/epa.texi, doc/misc/ert.texi, doc/misc/eshell.texi:
* doc/misc/eww.texi, doc/misc/flymake.texi, doc/misc/gnus.texi:
* doc/misc/info.texi, doc/misc/message.texi, doc/misc/mh-e.texi:
* doc/misc/newsticker.texi, doc/misc/pcl-cvs.texi, doc/misc/rcirc.texi:
* doc/misc/sem-user.texi, doc/misc/smtpmail.texi, doc/misc/url.texi:
* doc/misc/viper.texi, doc/misc/wisent.texi, doc/misc/woman.texi:
Use @file for buffers, per the Texinfo manual.
2014-03-12 20:52:34 +00:00
|
|
|
to look in the @file{*Messages*} buffer.
|
2013-12-23 12:50:47 +00:00
|
|
|
@end defvar
|
|
|
|
|
2012-04-09 13:10:22 +00:00
|
|
|
@defvar gnutls-min-prime-bits
|
|
|
|
The @code{gnutls-min-prime-bits} variable is a pretty exotic
|
|
|
|
customization for cases where you want to refuse handshakes with keys
|
|
|
|
under a specific size. If you don't know for sure that you need it,
|
|
|
|
you don't. Leave it @code{nil}.
|
|
|
|
@end defvar
|
|
|
|
|
|
|
|
@node Help For Developers
|
|
|
|
@chapter Help For Developers
|
|
|
|
|
|
|
|
The GnuTLS library is detected automatically at compile time. You
|
|
|
|
should see that it's enabled in the @code{configure} output. If not,
|
|
|
|
follow the standard procedure for finding out why a system library is
|
|
|
|
not picked up by the Emacs compilation. On the W32 (Windows)
|
|
|
|
platform, installing the DLLs with a recent build should be enough.
|
|
|
|
|
|
|
|
Just use @code{open-protocol-stream} or @code{open-network-stream}
|
|
|
|
(the two are equivalent, the first one being an alias to the second).
|
|
|
|
You should not have to use the @file{gnutls.el} functions directly.
|
|
|
|
But you can test them with @code{open-gnutls-stream}.
|
|
|
|
|
2016-01-31 00:34:45 +00:00
|
|
|
@defun open-gnutls-stream name buffer host service &optional nowait
|
2012-04-09 13:10:22 +00:00
|
|
|
This function creates a buffer connected to a specific @var{host} and
|
|
|
|
@var{service} (port number or service name). The parameters and their
|
|
|
|
syntax are the same as those given to @code{open-network-stream}
|
|
|
|
(@pxref{Network,, Network Connections, elisp, The Emacs Lisp Reference
|
|
|
|
Manual}). The connection process is called @var{name} (made unique if
|
|
|
|
necessary). This function returns the connection process.
|
|
|
|
|
2016-02-03 01:43:24 +00:00
|
|
|
The @var{nowait} parameter means that the scoket should be
|
|
|
|
asynchronous, and the connection process will be returned to the
|
|
|
|
caller before TLS negotiation has happened.
|
|
|
|
|
2012-04-09 13:10:22 +00:00
|
|
|
@lisp
|
|
|
|
;; open a HTTPS connection
|
|
|
|
(open-gnutls-stream "tls" "tls-buffer" "yourserver.com" "https")
|
|
|
|
|
|
|
|
;; open a IMAPS connection
|
|
|
|
(open-gnutls-stream "tls" "tls-buffer" "imap.gmail.com" "imaps")
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
@end defun
|
|
|
|
|
2016-01-31 01:32:21 +00:00
|
|
|
@findex gnutls-asynchronous-parameters
|
|
|
|
If called with @var{nowait}, the process is returned immediately
|
|
|
|
(before connecting to the server). In that case, the process object
|
|
|
|
is told what parameters to use when negotiating the connection
|
|
|
|
by using the @code{gnutls-asynchronous-parameters} function.
|
|
|
|
|
2012-04-09 13:10:22 +00:00
|
|
|
The function @code{gnutls-negotiate} is not generally useful and it
|
|
|
|
may change as needed, so please see @file{gnutls.el} for the details.
|
|
|
|
|
|
|
|
@defun gnutls-negotiate spec
|
|
|
|
Please see @file{gnutls.el} for the @var{spec} details and for usage,
|
|
|
|
but do not rely on this function's interface if possible.
|
|
|
|
@end defun
|
|
|
|
|
2012-12-21 19:01:24 +00:00
|
|
|
@node GNU Free Documentation License
|
|
|
|
@appendix GNU Free Documentation License
|
|
|
|
@include doclicense.texi
|
|
|
|
|
2012-04-09 13:10:22 +00:00
|
|
|
@node Function Index
|
2012-12-21 19:01:24 +00:00
|
|
|
@unnumbered Function Index
|
2012-04-09 13:10:22 +00:00
|
|
|
@printindex fn
|
|
|
|
|
|
|
|
@node Variable Index
|
2012-12-21 19:01:24 +00:00
|
|
|
@unnumbered Variable Index
|
2012-04-09 13:10:22 +00:00
|
|
|
@printindex vr
|
|
|
|
|
|
|
|
@bye
|
|
|
|
|
|
|
|
@c End:
|