1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
5 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017, 2018 ng0 <ng0@n0.is>
10 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
11 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
13 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
15 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
16 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
17 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages tls)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix utils)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system go)
42 #:use-module (guix build-system perl)
43 #:use-module (guix build-system python)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system trivial)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages bash)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages curl)
51 #:use-module (gnu packages dns)
52 #:use-module (gnu packages gawk)
53 #:use-module (gnu packages guile)
54 #:use-module (gnu packages hurd)
55 #:use-module (gnu packages libbsd)
56 #:use-module (gnu packages libffi)
57 #:use-module (gnu packages libidn)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages ncurses)
60 #:use-module (gnu packages nettle)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-crypto)
65 #:use-module (gnu packages python-web)
66 #:use-module (gnu packages python-xyz)
67 #:use-module (gnu packages sphinx)
68 #:use-module (gnu packages texinfo)
69 #:use-module (gnu packages time)
70 #:use-module (gnu packages base)
71 #:use-module (srfi srfi-1))
73 (define-public libtasn1
80 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
84 "179jskl7dmfp1rd2khkzmlibzgki4wi6hvmmwfv7q49r728b03qf"))))
85 (build-system gnu-build-system)
87 `(#:configure-flags '("--disable-static")))
88 (native-inputs `(("perl" ,perl)))
89 (home-page "https://www.gnu.org/software/libtasn1/")
90 (synopsis "ASN.1 library")
92 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
93 for transmitting machine-neutral encodings of data objects in computer
94 networking, allowing for formal validation of data according to some
96 (license license:lgpl2.0+)))
104 (uri (string-append "https://lionet.info/soft/asn1c-"
108 "1fc64g45ykmv73kdndr4zdm4wxhimhrir4rxnygxvwkych5l81w0"))))
109 (build-system gnu-build-system)
112 (home-page "https://lionet.info/asn1c")
113 (synopsis "ASN.1 to C compiler")
114 (description "The ASN.1 to C compiler takes ASN.1 module
115 files and generates C++ compatible C source code. That code can be
116 used to serialize the native C structures into compact and unambiguous
117 BER/XER/PER-based data files, and deserialize the files back.
119 Various ASN.1 based formats are widely used in the industry, such as to encode
120 the X.509 certificates employed in the HTTPS handshake, to exchange control
121 data between mobile phones and cellular networks, to car-to-car communication
122 in intelligent transportation networks.")
123 (license license:bsd-2)))
125 (define-public p11-kit
132 (uri (string-append "https://github.com/p11-glue/p11-kit/releases/"
133 "download/" version "/p11-kit-" version ".tar.xz"))
136 "0131maw666ha4d6iyj13fkz18c4pnb3lw2xwv5kvkmnzqcj61n0l"))))
137 (build-system gnu-build-system)
139 `(("pkg-config" ,pkg-config)))
142 ("libtasn1" ,libtasn1)))
144 `(#:configure-flags '("--without-trust-paths")
145 #:phases (modify-phases %standard-phases
146 (add-before 'check 'prepare-tests
148 ;; "test-runtime" expects XDG_RUNTIME_DIR to be set up
149 ;; and looks for .cache and other directories (only).
150 ;; For simplicity just drop it since it is irrelevant
151 ;; in the build container.
152 (substitute* "Makefile"
153 (("test-runtime\\$\\(EXEEXT\\)") ""))
155 (home-page "https://p11-glue.freedesktop.org/p11-kit.html")
156 (synopsis "PKCS#11 library")
158 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
159 provides a standard configuration setup for installing PKCS#11 modules
160 in such a way that they are discoverable. It also solves problems with
161 coordinating the use of PKCS#11 by different components or libraries
162 living in the same process.")
163 (license license:bsd-3)))
165 (define-public gnutls
168 (replacement gnutls-3.6.13)
173 ;; Note: Releases are no longer on ftp.gnu.org since the
174 ;; schism (after version 3.1.5).
175 (string-append "mirror://gnupg/gnutls/v"
176 (version-major+minor version)
177 "/gnutls-" version ".tar.xz"))
178 (patches (search-patches "gnutls-skip-trust-store-test.patch"))
181 "0jvca1qahn9lrwv6f5kfs95icirc15b2a8x9fzczyj996ipg3b5z"))))
182 (build-system gnu-build-system)
184 `(; Ensure we don't keep a reference to this buggy software.
185 #:disallowed-references (,net-tools)
188 ;; GnuTLS doesn't consult any environment variables to specify
189 ;; the location of the system-wide trust store. Instead it has a
190 ;; configure-time option. Unless specified, its configure script
191 ;; attempts to auto-detect the location by looking for common
192 ;; places in the file system, none of which are present in our
193 ;; chroot build environment. If not found, then no default trust
194 ;; store is used, so each program has to provide its own
195 ;; fallback, and users have to configure each program
196 ;; independently. This seems suboptimal.
197 "--with-default-trust-store-dir=/etc/ssl/certs"
199 ;; Tell the build system that we want Guile bindings installed to
200 ;; the output instead of Guiles own module directory.
201 (string-append "--with-guile-site-dir="
202 "$(datarootdir)/guile/site/$(GUILE_EFFECTIVE_VERSION)")
203 (string-append "--with-guile-site-ccache-dir="
204 "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache")
205 (string-append "--with-guile-extension-dir="
206 "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/extensions")
208 ;; FIXME: Temporarily disable p11-kit support since it is not
209 ;; working on mips64el.
212 #:phases (modify-phases %standard-phases
215 (lambda* (#:key outputs #:allow-other-keys)
216 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
217 (let* ((out (assoc-ref outputs "out"))
218 (doc (assoc-ref outputs "doc"))
219 (mandir (string-append doc "/share/man/man3"))
220 (oldman (string-append out "/share/man/man3")))
222 (copy-recursively oldman mandir)
223 (delete-file-recursively oldman)
225 (outputs '("out" ;4.4 MiB
227 "doc")) ;4.1 MiB of man pages
229 `(,@(if (hurd-target?) '()
230 `(("net-tools" ,net-tools)))
231 ("pkg-config" ,pkg-config)
233 ("datefudge" ,datefudge) ;tests rely on 'datefudge'
234 ("util-linux" ,util-linux))) ;one test needs 'setsid'
236 `(("guile" ,guile-3.0)))
238 ;; These are all in the 'Requires.private' field of gnutls.pc.
239 `(("libtasn1" ,libtasn1)
243 (home-page "https://www.gnu.org/software/gnutls/")
244 (synopsis "Transport layer security library")
246 "GnuTLS is a secure communications library implementing the SSL, TLS
247 and DTLS protocols. It is provided in the form of a C library to support the
248 protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
249 required structures.")
250 (license license:lgpl2.1+)
251 (properties '((ftp-server . "ftp.gnutls.org")
252 (ftp-directory . "/gcrypt/gnutls")))))
254 (define-public gnutls-3.6.13
260 (uri (string-append "mirror://gnupg/gnutls/v"
261 (version-major+minor version)
262 "/gnutls-3.6.13.tar.xz"))
263 (patches (search-patches "gnutls-skip-trust-store-test.patch"
264 "gnutls-cross.patch"))
267 "0f1gnm0756qms5cpx6yn6xb8d3imc2gkqmygf12n9x6r8zs1s11j"))))
269 `(,@(if (%current-target-system) ;for cross-build
270 `(("guile" ,guile-3.0)) ;to create .go files
272 ,@(package-native-inputs gnutls)))))
274 (define-public gnutls/guile-2.0
275 ;; GnuTLS for Guile 2.0.
276 (package/inherit gnutls
277 (name "guile2.0-gnutls")
278 (inputs `(("guile" ,guile-2.0)
279 ,@(alist-delete "guile" (package-inputs gnutls))))))
281 (define-public gnutls/dane
282 ;; GnuTLS with build libgnutls-dane, implementing DNS-based
283 ;; Authentication of Named Entities. This is required for GNS functionality
284 ;; by GNUnet and gnURL. This is done in an extra package definition
285 ;; to have the choice between GnuTLS with Dane and without Dane.
286 (package/inherit gnutls
288 (inputs `(("unbound" ,unbound)
289 ,@(package-inputs gnutls)))))
291 (define-public guile2.2-gnutls
294 (name "guile2.2-gnutls")
295 (inputs `(("guile" ,guile-2.2)
296 ,@(alist-delete "guile"
297 (package-inputs gnutls))))))
299 (define-public guile3.0-gnutls
300 (deprecated-package "guile3.0-gnutls" gnutls))
302 (define-public openssl
308 (uri (list (string-append "https://www.openssl.org/source/openssl-"
310 (string-append "ftp://ftp.openssl.org/source/"
311 "openssl-" version ".tar.gz")
312 (string-append "ftp://ftp.openssl.org/source/old/"
313 (string-trim-right version char-set:letter)
314 "/openssl-" version ".tar.gz")))
317 "0d9zv9srjqivs8nn099fpbjv1wyhfcb8lzy491dpmfngdvz6nv0q"))
318 (patches (search-patches "openssl-1.1-c-rehash-in.patch"))))
319 (build-system gnu-build-system)
321 "doc" ;6.8 MiB of man3 pages and full HTML documentation
322 "static")) ;6.4 MiB of .a files
323 (native-inputs `(("perl" ,perl)))
325 `(#:parallel-tests? #f
328 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
329 ;; so we explicitly disallow it here.
330 #:disallowed-references ,(list (canonical-package perl))
332 (modify-phases %standard-phases
333 ,@(if (%current-target-system)
335 'configure 'set-cross-compile
336 (lambda* (#:key target outputs #:allow-other-keys)
337 (setenv "CROSS_COMPILE" (string-append target "-"))
338 (setenv "CONFIGURE_TARGET_ARCH"
340 ((string-prefix? "i586" target)
342 ((string-prefix? "i686" target)
344 ((string-prefix? "x86_64" target)
346 ((string-prefix? "arm" target)
348 ((string-prefix? "aarch64" target)
353 (lambda* (#:key outputs #:allow-other-keys)
354 (let* ((out (assoc-ref outputs "out"))
355 (lib (string-append out "/lib")))
356 ;; It's not a shebang so patch-source-shebangs misses it.
357 (substitute* "config"
359 (string-append (assoc-ref %build-inputs "coreutils")
361 (invoke ,@(if (%current-target-system)
364 "shared" ;build shared libraries
367 ;; The default for this catch-all directory is
368 ;; PREFIX/ssl. Change that to something more
370 (string-append "--openssldir=" out
371 "/share/openssl-" ,version)
373 (string-append "--prefix=" out)
374 (string-append "-Wl,-rpath," lib)
375 ,@(if (%current-target-system)
376 '((getenv "CONFIGURE_TARGET_ARCH"))
378 (add-after 'install 'move-static-libraries
379 (lambda* (#:key outputs #:allow-other-keys)
380 ;; Move static libraries to the "static" output.
381 (let* ((out (assoc-ref outputs "out"))
382 (lib (string-append out "/lib"))
383 (static (assoc-ref outputs "static"))
384 (slib (string-append static "/lib")))
385 (for-each (lambda (file)
386 (install-file file slib)
388 (find-files lib "\\.a$"))
390 (add-after 'install 'move-extra-documentation
391 (lambda* (#:key outputs #:allow-other-keys)
392 ;; Move man3 pages and full HTML documentation to "doc".
393 (let* ((out (assoc-ref outputs "out"))
394 (man3 (string-append out "/share/man/man3"))
395 (html (string-append out "/share/doc/openssl"))
396 (doc (assoc-ref outputs "doc"))
397 (man-target (string-append doc "/share/man/man3"))
398 (html-target (string-append doc "/share/doc/openssl")))
399 (copy-recursively man3 man-target)
400 (delete-file-recursively man3)
401 (copy-recursively html html-target)
402 (delete-file-recursively html)
405 'install 'remove-miscellany
406 (lambda* (#:key outputs #:allow-other-keys)
407 ;; The 'misc' directory contains random undocumented shell and Perl
408 ;; scripts. Remove them to avoid retaining a reference on Perl.
409 (let ((out (assoc-ref outputs "out")))
410 (delete-file-recursively (string-append out "/share/openssl-"
414 (list (search-path-specification
415 (variable "SSL_CERT_DIR")
416 (separator #f) ;single entry
417 (files '("etc/ssl/certs")))
418 (search-path-specification
419 (variable "SSL_CERT_FILE")
421 (separator #f) ;single entry
422 (files '("etc/ssl/certs/ca-certificates.crt")))))
423 (synopsis "SSL/TLS implementation")
425 "OpenSSL is an implementation of SSL/TLS.")
426 (license license:openssl)
427 (home-page "https://www.openssl.org/")))
429 (define-public openssl-1.0
436 (uri (list (string-append "https://www.openssl.org/source/openssl-"
438 (string-append "ftp://ftp.openssl.org/source/"
439 "openssl-" version ".tar.gz")
440 (string-append "ftp://ftp.openssl.org/source/old/"
441 (string-trim-right version char-set:letter)
442 "/openssl-" version ".tar.gz")))
445 "05lxcs4hzyfqd5jn0d9p0fvqna62v2s4pc9qgmq0dpcknkzwdl7c"))
446 (patches (search-patches "openssl-runpath.patch"
447 "openssl-c-rehash-in.patch"))))
449 "doc" ;1.5MiB of man3 pages
450 "static")) ;6MiB of .a files
452 (substitute-keyword-arguments (package-arguments openssl)
453 ;; Parallel build is not supported in 1.0.x.
454 ((#:parallel-build? _ #f) #f)
456 `(modify-phases ,phases
457 (add-before 'patch-source-shebangs 'patch-tests
458 (lambda* (#:key inputs native-inputs #:allow-other-keys)
459 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
460 (substitute* (find-files "test" ".*")
462 (string-append bash "/bin/sh"))
466 (add-before 'configure 'patch-Makefile.org
467 (lambda* (#:key outputs #:allow-other-keys)
468 ;; The default MANDIR is some unusual place. Fix that.
469 (let ((out (assoc-ref outputs "out")))
470 (patch-makefile-SHELL "Makefile.org")
471 (substitute* "Makefile.org"
472 (("^MANDIR[[:blank:]]*=.*$")
473 (string-append "MANDIR = " out "/share/man\n")))
476 ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
477 (lambda* (#:key outputs #:allow-other-keys)
478 (let ((out (assoc-ref outputs "out")))
479 (invoke ,@(if (%current-target-system)
482 "shared" ;build shared libraries
485 ;; The default for this catch-all directory is
486 ;; PREFIX/ssl. Change that to something more
488 (string-append "--openssldir=" out
489 "/share/openssl-" ,version)
491 (string-append "--prefix=" out)
492 ,@(if (%current-target-system)
493 '((getenv "CONFIGURE_TARGET_ARCH"))
495 (delete 'move-extra-documentation)
496 (add-after 'install 'move-man3-pages
497 (lambda* (#:key outputs #:allow-other-keys)
498 ;; Move section 3 man pages to "doc".
499 (let* ((out (assoc-ref outputs "out"))
500 (man3 (string-append out "/share/man/man3"))
501 (doc (assoc-ref outputs "doc"))
502 (target (string-append doc "/share/man/man3")))
504 (for-each (lambda (file)
506 (string-append target "/"
509 (delete-file-recursively man3)
511 ;; XXX: Duplicate this phase to make sure 'version' evaluates
512 ;; in the current scope and not the inherited one.
513 (replace 'remove-miscellany
514 (lambda* (#:key outputs #:allow-other-keys)
515 ;; The 'misc' directory contains random undocumented shell and Perl
516 ;; scripts. Remove them to avoid retaining a reference on Perl.
517 (let ((out (assoc-ref outputs "out")))
518 (delete-file-recursively (string-append out "/share/openssl-"
522 (define-public libressl
528 (uri (string-append "mirror://openbsd/LibreSSL/"
529 "libressl-" version ".tar.gz"))
532 "13ir2lpxz8y1m151k7lrx306498nzfhwlvgkgv97v5cvywmifyyz"))))
533 (build-system gnu-build-system)
535 ;; Do as if 'getentropy' was missing since older Linux kernels lack it
536 ;; and libc would return ENOSYS, which is not properly handled.
537 ;; See <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00235.html>.
538 '(#:configure-flags '("ac_cv_func_getentropy=no"
539 ;; Provide a TLS-enabled netcat.
542 (list (search-path-specification
543 (variable "SSL_CERT_DIR")
544 (separator #f) ;single entry
545 (files '("etc/ssl/certs")))
546 (search-path-specification
547 (variable "SSL_CERT_FILE")
548 (separator #f) ;single entry
549 (files '("etc/ssl/certs/ca-certificates.crt")))))
550 (home-page "https://www.libressl.org/")
551 (synopsis "SSL/TLS implementation")
552 (description "LibreSSL is a version of the TLS/crypto stack, forked from
553 OpenSSL in 2014 with the goals of modernizing the codebase, improving security,
554 and applying best practice development processes. This package also includes a
555 netcat implementation that supports TLS.")
556 ;; Files taken from OpenSSL keep their license, others are under various
557 ;; non-copyleft licenses.
558 (license (list license:openssl
559 (license:non-copyleft
561 "See COPYING in the distribution.")))))
563 (define-public python-acme
566 ;; Remember to update the hash of certbot when updating python-acme.
570 (uri (pypi-uri "acme" version))
573 "03fjmg0fgfy7xfn3i8rzn9i0i4amajmijkash84qb8mlphgrxpn0"))))
574 (build-system python-build-system)
577 (modify-phases %standard-phases
578 (add-after 'build 'build-documentation
580 (invoke "make" "-C" "docs" "man" "info")))
581 (add-after 'install 'install-documentation
582 (lambda* (#:key outputs #:allow-other-keys)
583 (let* ((out (assoc-ref outputs "out"))
584 (man (string-append out "/share/man/man1"))
585 (info (string-append out "/info")))
586 (install-file "docs/_build/texinfo/acme-python.info" info)
587 (install-file "docs/_build/man/acme-python.1" man)
589 ;; TODO: Add optional inputs for testing.
591 `(("python-mock" ,python-mock)
592 ("python-pytest" ,python-pytest)
594 ("python-sphinx" ,python-sphinx)
595 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
596 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
597 ("texinfo" ,texinfo)))
599 `(("python-josepy" ,python-josepy)
600 ("python-six" ,python-six)
601 ("python-requests" ,python-requests)
602 ("python-requests-toolbelt" ,python-requests-toolbelt)
603 ("python-pytz" ,python-pytz)
604 ("python-pyrfc3339" ,python-pyrfc3339)
605 ("python-pyasn1" ,python-pyasn1)
606 ("python-cryptography" ,python-cryptography)
607 ("python-pyopenssl" ,python-pyopenssl)))
608 (home-page "https://github.com/certbot/certbot")
609 (synopsis "ACME protocol implementation in Python")
610 (description "ACME protocol implementation in Python")
611 (license license:asl2.0)))
613 (define-public certbot
616 ;; Certbot and python-acme are developed in the same repository, and their
617 ;; versions should remain synchronized.
618 (version (package-version python-acme))
621 (uri (pypi-uri "certbot" version))
624 "1n5i0k6kwmd6wvivshfl3k4djwcpwx390c39xmr2hhrgpk5r285w"))))
625 (build-system python-build-system)
627 `(,@(substitute-keyword-arguments (package-arguments python-acme)
629 `(modify-phases ,phases
630 (replace 'install-documentation
631 (lambda* (#:key outputs #:allow-other-keys)
632 (let* ((out (assoc-ref outputs "out"))
633 (man1 (string-append out "/share/man/man1"))
634 (man7 (string-append out "/share/man/man7"))
635 (info (string-append out "/info")))
636 (install-file "docs/_build/texinfo/Certbot.info" info)
637 (install-file "docs/_build/man/certbot.1" man1)
638 (install-file "docs/_build/man/certbot.7" man7)
640 ;; TODO: Add optional inputs for testing.
642 `(("python-mock" ,python-mock)
643 ("python-pytest" ,python-pytest)
645 ("python-sphinx" ,python-sphinx)
646 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
647 ("python-sphinx-repoze-autointerface" ,python-sphinx-repoze-autointerface)
648 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
649 ("texinfo" ,texinfo)))
651 `(("python-acme" ,python-acme)
652 ("python-cryptography" ,python-cryptography)
653 ("python-zope-interface" ,python-zope-interface)
654 ("python-pyrfc3339" ,python-pyrfc3339)
655 ("python-pyopenssl" ,python-pyopenssl)
656 ("python-configobj" ,python-configobj)
657 ("python-configargparse" ,python-configargparse)
658 ("python-distro" ,python-distro)
659 ("python-zope-component" ,python-zope-component)
660 ("python-parsedatetime" ,python-parsedatetime)
661 ("python-six" ,python-six)
662 ("python-psutil" ,python-psutil)
663 ("python-requests" ,python-requests)
664 ("python-pytz" ,python-pytz)))
665 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
666 (description "Certbot automatically receives and installs X.509 certificates
667 to enable Transport Layer Security (TLS) on servers. It interoperates with the
668 Let’s Encrypt certificate authority (CA), which issues browser-trusted
669 certificates for free.")
670 (home-page "https://certbot.eff.org/")
671 (license license:asl2.0)))
673 (define-public letsencrypt
674 (package (inherit certbot)
676 (properties `((superseded . ,certbot)))))
678 (define-public perl-net-ssleay
680 (name "perl-net-ssleay")
684 (uri (string-append "mirror://cpan/authors/id/C/CH/CHRISN/"
685 "Net-SSLeay-" version ".tar.gz"))
688 "1pfgh4h3szcpvqlcimc60pjbk9zwls99x5863sva0wc47i4dl010"))))
689 (build-system perl-build-system)
690 (inputs `(("openssl" ,openssl)))
693 (modify-phases %standard-phases
695 'configure 'set-ssl-prefix
696 (lambda* (#:key inputs #:allow-other-keys)
697 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
699 (synopsis "Perl extension for using OpenSSL")
701 "This module offers some high level convenience functions for accessing
702 web pages on SSL servers (for symmetry, the same API is offered for accessing
703 http servers, too), an sslcat() function for writing your own clients, and
704 finally access to the SSL api of the SSLeay/OpenSSL package so you can write
705 servers or clients for more complicated applications.")
706 (license license:perl-license)
707 (home-page "https://metacpan.org/release/Net-SSLeay")))
709 (define-public perl-crypt-openssl-rsa
711 (name "perl-crypt-openssl-rsa")
717 "mirror://cpan/authors/id/T/TO/TODDR/Crypt-OpenSSL-RSA-"
722 "0djl5i6kibl7862b6ih29q8dhg5zpwzq77q9j8hp6xngshx40ws1"))))
723 (build-system perl-build-system)
725 `(("perl-crypt-openssl-guess" ,perl-crypt-openssl-guess)))
727 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
728 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
729 ("openssl" ,openssl)))
730 (arguments perl-crypt-arguments)
732 "https://metacpan.org/release/Crypt-OpenSSL-RSA")
734 "RSA encoding and decoding, using the openSSL libraries")
735 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
736 OpenSSL libraries).")
737 (license license:perl-license)))
739 (define perl-crypt-arguments
740 `(#:phases (modify-phases %standard-phases
741 (add-before 'configure 'patch-Makefile.PL
742 (lambda* (#:key inputs #:allow-other-keys)
743 (substitute* "Makefile.PL"
744 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
745 (assoc-ref inputs "openssl")
746 "/lib -lcrypto'],")))
749 (define-public perl-crypt-openssl-bignum
751 (name "perl-crypt-openssl-bignum")
757 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
762 "1p22znbajq91lbk2k3yg12ig7hy5b4vy8igxwqkmbm4nhgxp4ki3"))))
763 (build-system perl-build-system)
764 (inputs `(("openssl" ,openssl)))
765 (arguments perl-crypt-arguments)
767 "https://metacpan.org/release/Crypt-OpenSSL-Bignum")
769 "OpenSSL's multiprecision integer arithmetic in Perl")
770 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
771 arithmetic in Perl.")
772 ;; At your option either gpl1+ or the Artistic License
773 (license license:perl-license)))
775 (define-public perl-crypt-openssl-guess
777 (name "perl-crypt-openssl-guess")
783 "mirror://cpan/authors/id/A/AK/AKIYM/Crypt-OpenSSL-Guess-"
787 "0rvi9l4ljcbhwwvspq019nfq2h2v746dk355h2nwnlmqikiihsxa"))))
788 (build-system perl-build-system)
789 (home-page "https://metacpan.org/release/Crypt-OpenSSL-Guess")
790 (synopsis "Guess the OpenSSL include path")
792 "The Crypt::OpenSSL::Guess Perl module provides helpers to guess the
793 correct OpenSSL include path. It is intended for use in your
794 @file{Makefile.PL}.")
795 (license license:perl-license)))
797 (define-public perl-crypt-openssl-random
799 (name "perl-crypt-openssl-random")
805 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
809 (base32 "1x6ffps8q7mnawmcfq740llzy7i10g3319vap0wiw4d33fm6z1zh"))))
810 (build-system perl-build-system)
812 `(("perl-crypt-openssl-guess" ,perl-crypt-openssl-guess)))
814 `(("openssl" ,openssl)))
815 (arguments perl-crypt-arguments)
817 "https://metacpan.org/release/Crypt-OpenSSL-Random")
819 "OpenSSL/LibreSSL pseudo-random number generator access")
820 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
822 (license license:perl-license)))
824 (define-public acme-client
830 (uri (string-append "https://kristaps.bsd.lv/" name "/"
831 "snapshots/" name "-portable-"
835 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
836 (build-system gnu-build-system)
838 '(#:tests? #f ; no test suite
841 (string-append "PREFIX=" (assoc-ref %outputs "out")))
843 (modify-phases %standard-phases
844 (add-after 'unpack 'patch-paths
845 (lambda* (#:key inputs #:allow-other-keys)
846 (let ((pem (string-append (assoc-ref inputs "libressl")
847 "/etc/ssl/cert.pem")))
848 (substitute* "http.c"
849 (("/etc/ssl/cert.pem") pem))
851 (delete 'configure)))) ; no './configure' script
853 `(("pkg-config" ,pkg-config)))
856 ("libressl" ,libressl)))
857 (synopsis "Let's Encrypt client by the OpenBSD project")
858 (description "acme-client is a Let's Encrypt client implemented in C. It
859 uses a modular design, and attempts to secure itself by dropping privileges and
860 operating in a chroot where possible. acme-client is developed on OpenBSD and
861 then ported to the GNU / Linux environment.")
862 (home-page "https://kristaps.bsd.lv/acme-client/")
863 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
864 ;; and 'jsmn.c' are distributed under the Expat license.
865 (license (list license:isc license:expat))))
867 ;; The "-apache" variant is the upstreamed prefered variant. A "-gpl"
868 ;; variant exists in addition to the "-apache" one.
869 (define-public mbedtls-apache
871 (name "mbedtls-apache")
876 ;; XXX: The download links on the website are script redirection links
877 ;; which effectively lead to the format listed in the uri here.
878 (uri (string-append "https://tls.mbed.org/download/mbedtls-"
879 version "-apache.tgz"))
882 "0kdhwy241xsk4isbadqx6z80m8sf76da5sbmqv8qy11yr37cdd35"))))
883 (build-system cmake-build-system)
886 (list "-DUSE_SHARED_MBEDTLS_LIBRARY=ON"
887 "-DUSE_STATIC_MBEDTLS_LIBRARY=OFF")))
891 (synopsis "Small TLS library")
893 "@code{mbed TLS}, formerly known as PolarSSL, makes it trivially easy
894 for developers to include cryptographic and SSL/TLS capabilities in their
895 (embedded) products, facilitating this functionality with a minimal
897 (home-page "https://tls.mbed.org")
898 (license license:asl2.0)))
900 ;; The Hiawatha Web server requires some specific features to be enabled.
901 (define-public mbedtls-for-hiawatha
904 (inherit mbedtls-apache)
906 (substitute-keyword-arguments
908 (modify-phases %standard-phases
909 (add-after 'configure 'configure-extra-features
911 (for-each (lambda (feature)
912 (invoke "scripts/config.pl" "set" feature))
913 (list "MBEDTLS_THREADING_C"
914 "MBEDTLS_THREADING_PTHREAD"))
916 ,@(package-arguments mbedtls-apache)))))))
918 (define-public dehydrated
925 "https://github.com/dehydrated-io/dehydrated/releases/download/"
926 "v" version "/dehydrated-" version ".tar.gz"))
929 "0dgskgbdd95p13jx6s13p77y15wngb5cm6p4305cf2s54w0bvahh"))))
930 (build-system trivial-build-system)
932 `(#:modules ((guix build utils)
936 (use-modules (guix build utils)
938 (let* ((source (assoc-ref %build-inputs "source"))
939 (tar (assoc-ref %build-inputs "tar"))
940 (gz (assoc-ref %build-inputs "gzip"))
941 (out (assoc-ref %outputs "out"))
942 (bin (string-append out "/bin"))
943 (doc (string-append out "/share/doc/" ,name "-" ,version))
944 (man (string-append out "/share/man"))
945 (bash (in-vicinity (assoc-ref %build-inputs "bash") "bin")))
947 (setenv "PATH" (string-append gz "/bin"))
948 (invoke (string-append tar "/bin/tar") "xvf" source)
949 (chdir (string-append ,name "-" ,version))
951 (copy-recursively "docs" doc)
952 (install-file "LICENSE" doc)
955 (rename-file (string-append doc "/man")
956 (string-append man "/man1"))
957 (for-each (cut invoke "gzip" "-9" <>)
958 (find-files man ".*"))
960 (install-file "dehydrated" bin)
961 (with-directory-excursion bin
962 (patch-shebang "dehydrated" (list bash))
964 ;; Do not try to write to the store.
965 (substitute* "dehydrated"
966 (("SCRIPTDIR=\"\\$.*\"") "SCRIPTDIR=~/.dehydrated"))
969 (wrap-program "dehydrated"
972 (string-append dir "/bin"))
974 (assoc-ref %build-inputs input))
985 ("coreutils" ,coreutils)
987 ("diffutils" ,diffutils)
995 (home-page "https://dehydrated.io/")
996 (synopsis "Let's Encrypt/ACME client implemented as a shell script")
997 (description "Dehydrated is a client for signing certificates with an
998 ACME-server (currently only provided by Let's Encrypt) implemented as a
999 relatively simple Bash script.")
1000 (license license:expat)))
1002 (define-public go-github-com-certifi-gocertifi
1003 (let ((commit "a5e0173ced670013bfb649c7e806bc9529c986ec")
1006 (name "go-github-com-certifi-gocertifi")
1007 (version (git-version "2018.01.18" revision commit))
1011 (url "https://github.com/certifi/gocertifi")
1013 (file-name (git-file-name name version))
1016 "1n9drccl3q1rr8wg3nf60slkf1lgsmz5ahifrglbdrc6har3rryj"))))
1017 (build-system go-build-system)
1019 '(#:import-path "github.com/certifi/gocertifi"))
1020 (synopsis "X.509 TLS root certificate bundle for Go")
1021 (description "This package is a Go language X.509 TLS root certificate bundle,
1022 derived from Mozilla's collection.")
1023 (home-page "https://certifi.io")
1024 (license license:mpl2.0))))