1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2019 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 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>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages tls)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix utils)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system go)
41 #:use-module (guix build-system perl)
42 #:use-module (guix build-system python)
43 #:use-module (guix build-system cmake)
44 #:use-module (guix build-system trivial)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages bash)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages dns)
51 #:use-module (gnu packages gawk)
52 #:use-module (gnu packages guile)
53 #:use-module (gnu packages libbsd)
54 #:use-module (gnu packages libffi)
55 #:use-module (gnu packages libidn)
56 #:use-module (gnu packages linux)
57 #:use-module (gnu packages ncurses)
58 #:use-module (gnu packages nettle)
59 #:use-module (gnu packages perl)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages python)
62 #:use-module (gnu packages python-crypto)
63 #:use-module (gnu packages python-web)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages sphinx)
66 #:use-module (gnu packages texinfo)
67 #:use-module (gnu packages time)
68 #:use-module (gnu packages base)
69 #:use-module (srfi srfi-1))
71 (define-public libtasn1
78 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
82 "17kkh89zfnwszw657fj13y2gamzay33lsrfazgm4sc7mx2gm0xyx"))))
83 (build-system gnu-build-system)
85 `(#:configure-flags '("--disable-static")))
86 (native-inputs `(("perl" ,perl)))
87 (home-page "https://www.gnu.org/software/libtasn1/")
88 (synopsis "ASN.1 library")
90 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
91 for transmitting machine-neutral encodings of data objects in computer
92 networking, allowing for formal validation of data according to some
94 (license license:lgpl2.0+)))
102 (uri (string-append "https://lionet.info/soft/asn1c-"
106 "1fc64g45ykmv73kdndr4zdm4wxhimhrir4rxnygxvwkych5l81w0"))))
107 (build-system gnu-build-system)
110 (home-page "https://lionet.info/asn1c")
111 (synopsis "ASN.1 to C compiler")
112 (description "The ASN.1 to C compiler takes ASN.1 module
113 files and generates C++ compatible C source code. That code can be
114 used to serialize the native C structures into compact and unambiguous
115 BER/XER/PER-based data files, and deserialize the files back.
117 Various ASN.1 based formats are widely used in the industry, such as to encode
118 the X.509 certificates employed in the HTTPS handshake, to exchange control
119 data between mobile phones and cellular networks, to car-to-car communication
120 in intelligent transportation networks.")
121 (license license:bsd-2)))
123 (define-public p11-kit
126 (version "0.23.18.1")
130 (uri (string-append "https://github.com/p11-glue/p11-kit/releases/"
131 "download/" version "/p11-kit-" version ".tar.gz"))
134 "0vrwab1082f7l5sbzpb28nrs3q4d2q7wzbi8c977rpah026bvhrl"))))
135 (build-system gnu-build-system)
137 `(("pkg-config" ,pkg-config)))
140 ("libtasn1" ,libtasn1)))
142 `(#:configure-flags '("--without-trust-paths")
143 #:phases (modify-phases %standard-phases
144 (add-before 'check 'prepare-tests
146 ;; "test-runtime" expects XDG_RUNTIME_DIR to be set up
147 ;; and looks for .cache and other directories (only).
148 ;; For simplicity just drop it since it is irrelevant
149 ;; in the build container.
150 (substitute* "Makefile"
151 (("test-runtime\\$\\(EXEEXT\\)") ""))
153 (home-page "https://p11-glue.freedesktop.org/p11-kit.html")
154 (synopsis "PKCS#11 library")
156 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
157 provides a standard configuration setup for installing PKCS#11 modules
158 in such a way that they are discoverable. It also solves problems with
159 coordinating the use of PKCS#11 by different components or libraries
160 living in the same process.")
161 (license license:bsd-3)))
163 (define-public gnutls
170 ;; Note: Releases are no longer on ftp.gnu.org since the
171 ;; schism (after version 3.1.5).
172 (string-append "mirror://gnupg/gnutls/v"
173 (version-major+minor version)
174 "/gnutls-" version ".tar.xz"))
175 (patches (search-patches "gnutls-skip-trust-store-test.patch"))
178 "1y1wadpsrj5ai603xv5bgssl9v0pb1si2hg14zqdnmcsvgri5fpv"))))
179 (build-system gnu-build-system)
181 `(; Ensure we don't keep a reference to this buggy software.
182 #:disallowed-references (,net-tools)
185 ;; GnuTLS doesn't consult any environment variables to specify
186 ;; the location of the system-wide trust store. Instead it has a
187 ;; configure-time option. Unless specified, its configure script
188 ;; attempts to auto-detect the location by looking for common
189 ;; places in the file system, none of which are present in our
190 ;; chroot build environment. If not found, then no default trust
191 ;; store is used, so each program has to provide its own
192 ;; fallback, and users have to configure each program
193 ;; independently. This seems suboptimal.
194 "--with-default-trust-store-dir=/etc/ssl/certs"
196 ;; Tell the build system that we want Guile bindings installed to
197 ;; the output instead of Guiles own module directory.
198 (string-append "--with-guile-site-dir="
199 "$(datarootdir)/guile/site/$(GUILE_EFFECTIVE_VERSION)")
200 (string-append "--with-guile-site-ccache-dir="
201 "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache")
202 (string-append "--with-guile-extension-dir="
203 "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/extensions")
205 ;; FIXME: Temporarily disable p11-kit support since it is not
206 ;; working on mips64el.
209 #:phases (modify-phases %standard-phases
212 (lambda* (#:key outputs #:allow-other-keys)
213 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
214 (let* ((out (assoc-ref outputs "out"))
215 (doc (assoc-ref outputs "doc"))
216 (mandir (string-append doc "/share/man/man3"))
217 (oldman (string-append out "/share/man/man3")))
219 (copy-recursively oldman mandir)
220 (delete-file-recursively oldman)
222 (outputs '("out" ;4.4 MiB
224 "doc")) ;4.1 MiB of man pages
226 `(("net-tools" ,net-tools)
227 ("pkg-config" ,pkg-config)
230 `(("guile" ,guile-2.2)))
232 ;; These are all in the 'Requires.private' field of gnutls.pc.
233 `(("libtasn1" ,libtasn1)
237 (home-page "https://www.gnu.org/software/gnutls/")
238 (synopsis "Transport layer security library")
240 "GnuTLS is a secure communications library implementing the SSL, TLS
241 and DTLS protocols. It is provided in the form of a C library to support the
242 protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
243 required structures.")
244 (license license:lgpl2.1+)
245 (properties '((ftp-server . "ftp.gnutls.org")
246 (ftp-directory . "/gcrypt/gnutls")))))
248 (define-public gnutls/guile-2.0
249 ;; GnuTLS for Guile 2.0.
252 (name "guile2.0-gnutls")
253 (inputs `(("guile" ,guile-2.0)
254 ,@(alist-delete "guile" (package-inputs gnutls))))))
256 (define-public gnutls/dane
257 ;; GnuTLS with build libgnutls-dane, implementing DNS-based
258 ;; Authentication of Named Entities. This is required for GNS functionality
259 ;; by GNUnet and gnURL. This is done in an extra package definition
260 ;; to have the choice between GnuTLS with Dane and without Dane.
264 (inputs `(("unbound" ,unbound)
265 ,@(package-inputs gnutls)))))
267 (define gnutls-3.6.10
268 ;; This is for 'guile3.0-gnutls', below. Version 3.6.10 is the first to
269 ;; introduce Guile 2.9/3.0 support.
274 (inherit (package-source gnutls))
275 (uri (string-append "mirror://gnupg/gnutls/v"
276 (version-major+minor version)
277 "/gnutls-" version ".tar.xz"))
280 "14r2h73yfj66cm14k9mnb3kgzq5a7qjg5b31m53bf19vcxkwmwxi"))))))
282 (define-public guile3.0-gnutls
284 (inherit gnutls-3.6.10)
285 (name "guile3.0-gnutls")
287 (substitute-keyword-arguments (package-arguments gnutls-3.6.10)
288 ((#:phases phases '%standard-phases)
289 `(modify-phases ,phases
290 (add-before 'build 'leave-guile-stdout-open
292 ;; Work around <https://bugs.gnu.org/38348>.
293 (substitute* "guile/Makefile"
294 (("out=-") "out=/dev/null"))
296 (inputs `(("guile" ,guile-next)
297 ,@(alist-delete "guile"
298 (package-inputs gnutls-3.6.10))))))
300 (define-public openssl
306 (uri (list (string-append "https://www.openssl.org/source/openssl-"
308 (string-append "ftp://ftp.openssl.org/source/"
309 "openssl-" version ".tar.gz")
310 (string-append "ftp://ftp.openssl.org/source/old/"
311 (string-trim-right version char-set:letter)
312 "/openssl-" version ".tar.gz")))
315 "1whinyw402z3b9xlb3qaxv4b9sk4w1bgh9k0y8df1z4x3yy92fhy"))
316 (patches (search-patches "openssl-1.1-c-rehash-in.patch"))))
317 (build-system gnu-build-system)
319 "doc" ;6.8 MiB of man3 pages and full HTML documentation
320 "static")) ;6.4 MiB of .a files
321 (native-inputs `(("perl" ,perl)))
323 `(#:disallowed-references (,perl)
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? "i686" target)
342 ((string-prefix? "x86_64" target)
344 ((string-prefix? "arm" target)
346 ((string-prefix? "aarch64" target)
351 (lambda* (#:key outputs #:allow-other-keys)
352 (let* ((out (assoc-ref outputs "out"))
353 (lib (string-append out "/lib")))
354 ;; It's not a shebang so patch-source-shebangs misses it.
355 (substitute* "config"
357 (string-append (assoc-ref %build-inputs "coreutils")
359 (invoke ,@(if (%current-target-system)
362 "shared" ;build shared libraries
365 ;; The default for this catch-all directory is
366 ;; PREFIX/ssl. Change that to something more
368 (string-append "--openssldir=" out
369 "/share/openssl-" ,version)
371 (string-append "--prefix=" out)
372 (string-append "-Wl,-rpath," lib)
373 ,@(if (%current-target-system)
374 '((getenv "CONFIGURE_TARGET_ARCH"))
376 (add-after 'install 'move-static-libraries
377 (lambda* (#:key outputs #:allow-other-keys)
378 ;; Move static libraries to the "static" output.
379 (let* ((out (assoc-ref outputs "out"))
380 (lib (string-append out "/lib"))
381 (static (assoc-ref outputs "static"))
382 (slib (string-append static "/lib")))
383 (for-each (lambda (file)
384 (install-file file slib)
386 (find-files lib "\\.a$"))
388 (add-after 'install 'move-extra-documentation
389 (lambda* (#:key outputs #:allow-other-keys)
390 ;; Move man3 pages and full HTML documentation to "doc".
391 (let* ((out (assoc-ref outputs "out"))
392 (man3 (string-append out "/share/man/man3"))
393 (html (string-append out "/share/doc/openssl"))
394 (doc (assoc-ref outputs "doc"))
395 (man-target (string-append doc "/share/man/man3"))
396 (html-target (string-append doc "/share/doc/openssl")))
397 (copy-recursively man3 man-target)
398 (delete-file-recursively man3)
399 (copy-recursively html html-target)
400 (delete-file-recursively html)
403 'install 'remove-miscellany
404 (lambda* (#:key outputs #:allow-other-keys)
405 ;; The 'misc' directory contains random undocumented shell and Perl
406 ;; scripts. Remove them to avoid retaining a reference on Perl.
407 (let ((out (assoc-ref outputs "out")))
408 (delete-file-recursively (string-append out "/share/openssl-"
412 (list (search-path-specification
413 (variable "SSL_CERT_DIR")
414 (separator #f) ;single entry
415 (files '("etc/ssl/certs")))
416 (search-path-specification
417 (variable "SSL_CERT_FILE")
419 (separator #f) ;single entry
420 (files '("etc/ssl/certs/ca-certificates.crt")))))
421 (synopsis "SSL/TLS implementation")
423 "OpenSSL is an implementation of SSL/TLS.")
424 (license license:openssl)
425 (home-page "https://www.openssl.org/")))
427 (define-public openssl-1.0
434 (uri (list (string-append "https://www.openssl.org/source/openssl-"
436 (string-append "ftp://ftp.openssl.org/source/"
437 "openssl-" version ".tar.gz")
438 (string-append "ftp://ftp.openssl.org/source/old/"
439 (string-trim-right version char-set:letter)
440 "/openssl-" version ".tar.gz")))
443 "1g67ra0ph7gpz6fgvv1i96d792jmd6ymci5kk53vbikszr74djql"))
444 (patches (search-patches "openssl-runpath.patch"
445 "openssl-c-rehash-in.patch"))))
447 "doc" ;1.5MiB of man3 pages
448 "static")) ;6MiB of .a files
450 (substitute-keyword-arguments (package-arguments openssl)
451 ;; Parallel build is not supported in 1.0.x.
452 ((#:parallel-build? _ #f) #f)
454 `(modify-phases ,phases
455 (add-before 'patch-source-shebangs 'patch-tests
456 (lambda* (#:key inputs native-inputs #:allow-other-keys)
457 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
458 (substitute* (find-files "test" ".*")
460 (string-append bash "/bin/sh"))
464 (add-before 'configure 'patch-Makefile.org
465 (lambda* (#:key outputs #:allow-other-keys)
466 ;; The default MANDIR is some unusual place. Fix that.
467 (let ((out (assoc-ref outputs "out")))
468 (patch-makefile-SHELL "Makefile.org")
469 (substitute* "Makefile.org"
470 (("^MANDIR[[:blank:]]*=.*$")
471 (string-append "MANDIR = " out "/share/man\n")))
474 ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
475 (lambda* (#:key outputs #:allow-other-keys)
476 (let ((out (assoc-ref outputs "out")))
477 (invoke ,@(if (%current-target-system)
480 "shared" ;build shared libraries
483 ;; The default for this catch-all directory is
484 ;; PREFIX/ssl. Change that to something more
486 (string-append "--openssldir=" out
487 "/share/openssl-" ,version)
489 (string-append "--prefix=" out)
490 ,@(if (%current-target-system)
491 '((getenv "CONFIGURE_TARGET_ARCH"))
493 (delete 'move-extra-documentation)
494 (add-after 'install 'move-man3-pages
495 (lambda* (#:key outputs #:allow-other-keys)
496 ;; Move section 3 man pages to "doc".
497 (let* ((out (assoc-ref outputs "out"))
498 (man3 (string-append out "/share/man/man3"))
499 (doc (assoc-ref outputs "doc"))
500 (target (string-append doc "/share/man/man3")))
502 (for-each (lambda (file)
504 (string-append target "/"
507 (delete-file-recursively man3)
509 ;; XXX: Duplicate this phase to make sure 'version' evaluates
510 ;; in the current scope and not the inherited one.
511 (replace 'remove-miscellany
512 (lambda* (#:key outputs #:allow-other-keys)
513 ;; The 'misc' directory contains random undocumented shell and Perl
514 ;; scripts. Remove them to avoid retaining a reference on Perl.
515 (let ((out (assoc-ref outputs "out")))
516 (delete-file-recursively (string-append out "/share/openssl-"
520 (define-public libressl
526 (uri (string-append "mirror://openbsd/LibreSSL/"
527 "libressl-" version ".tar.gz"))
530 "19kxa5i97q7p6rrps9qm0nd8zqhdjvzx02j72400c73cl2nryfhy"))))
531 (build-system gnu-build-system)
533 ;; Do as if 'getentropy' was missing since older Linux kernels lack it
534 ;; and libc would return ENOSYS, which is not properly handled.
535 ;; See <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00235.html>.
536 '(#:configure-flags '("ac_cv_func_getentropy=no"
537 ;; Provide a TLS-enabled netcat.
540 (list (search-path-specification
541 (variable "SSL_CERT_DIR")
542 (separator #f) ;single entry
543 (files '("etc/ssl/certs")))
544 (search-path-specification
545 (variable "SSL_CERT_FILE")
546 (separator #f) ;single entry
547 (files '("etc/ssl/certs/ca-certificates.crt")))))
548 (home-page "https://www.libressl.org/")
549 (synopsis "SSL/TLS implementation")
550 (description "LibreSSL is a version of the TLS/crypto stack, forked from
551 OpenSSL in 2014 with the goals of modernizing the codebase, improving security,
552 and applying best practice development processes. This package also includes a
553 netcat implementation that supports TLS.")
554 ;; Files taken from OpenSSL keep their license, others are under various
555 ;; non-copyleft licenses.
556 (license (list license:openssl
557 (license:non-copyleft
559 "See COPYING in the distribution.")))))
561 (define-public python-acme
564 ;; Remember to update the hash of certbot when updating python-acme.
568 (uri (pypi-uri "acme" version))
571 "1z2zibs9lyxi5gxw9bny1127bjliwsp476kai1wnnnwd8238dgrk"))))
572 (build-system python-build-system)
575 (modify-phases %standard-phases
576 (add-after 'build 'build-documentation
578 (invoke "make" "-C" "docs" "man" "info")))
579 (add-after 'install 'install-documentation
580 (lambda* (#:key outputs #:allow-other-keys)
581 (let* ((out (assoc-ref outputs "out"))
582 (man (string-append out "/share/man/man1"))
583 (info (string-append out "/info")))
584 (install-file "docs/_build/texinfo/acme-python.info" info)
585 (install-file "docs/_build/man/acme-python.1" man)
587 ;; TODO: Add optional inputs for testing.
589 `(("python-mock" ,python-mock)
590 ("python-pytest" ,python-pytest)
592 ("python-sphinx" ,python-sphinx)
593 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
594 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
595 ("texinfo" ,texinfo)))
597 `(("python-josepy" ,python-josepy)
598 ("python-six" ,python-six)
599 ("python-requests" ,python-requests)
600 ("python-requests-toolbelt" ,python-requests-toolbelt)
601 ("python-pytz" ,python-pytz)
602 ("python-pyrfc3339" ,python-pyrfc3339)
603 ("python-pyasn1" ,python-pyasn1)
604 ("python-cryptography" ,python-cryptography)
605 ("python-pyopenssl" ,python-pyopenssl)))
606 (home-page "https://github.com/certbot/certbot")
607 (synopsis "ACME protocol implementation in Python")
608 (description "ACME protocol implementation in Python")
609 (license license:asl2.0)))
611 (define-public certbot
614 ;; Certbot and python-acme are developed in the same repository, and their
615 ;; versions should remain synchronized.
616 (version (package-version python-acme))
619 (uri (pypi-uri "certbot" version))
622 "1l8h7ggq75h59246mmzigmjr5jvzi29hihrnz9aiqh6g8hq1pj4d"))))
623 (build-system python-build-system)
625 `(,@(substitute-keyword-arguments (package-arguments python-acme)
627 `(modify-phases ,phases
628 (replace 'install-documentation
629 (lambda* (#:key outputs #:allow-other-keys)
630 (let* ((out (assoc-ref outputs "out"))
631 (man1 (string-append out "/share/man/man1"))
632 (man7 (string-append out "/share/man/man7"))
633 (info (string-append out "/info")))
634 (install-file "docs/_build/texinfo/Certbot.info" info)
635 (install-file "docs/_build/man/certbot.1" man1)
636 (install-file "docs/_build/man/certbot.7" man7)
638 ;; TODO: Add optional inputs for testing.
640 `(("python-mock" ,python-mock)
641 ("python-pytest" ,python-pytest)
643 ("python-sphinx" ,python-sphinx)
644 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
645 ("python-sphinx-repoze-autointerface" ,python-sphinx-repoze-autointerface)
646 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
647 ("texinfo" ,texinfo)))
649 `(("python-acme" ,python-acme)
650 ("python-cryptography" ,python-cryptography)
651 ("python-zope-interface" ,python-zope-interface)
652 ("python-pyrfc3339" ,python-pyrfc3339)
653 ("python-pyopenssl" ,python-pyopenssl)
654 ("python-configobj" ,python-configobj)
655 ("python-configargparse" ,python-configargparse)
656 ("python-distro" ,python-distro)
657 ("python-zope-component" ,python-zope-component)
658 ("python-parsedatetime" ,python-parsedatetime)
659 ("python-six" ,python-six)
660 ("python-psutil" ,python-psutil)
661 ("python-requests" ,python-requests)
662 ("python-pytz" ,python-pytz)))
663 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
664 (description "Certbot automatically receives and installs X.509 certificates
665 to enable Transport Layer Security (TLS) on servers. It interoperates with the
666 Let’s Encrypt certificate authority (CA), which issues browser-trusted
667 certificates for free.")
668 (home-page "https://certbot.eff.org/")
669 (license license:asl2.0)))
671 (define-public letsencrypt
672 (package (inherit certbot)
674 (properties `((superseded . ,certbot)))))
676 (define-public perl-net-ssleay
678 (name "perl-net-ssleay")
682 (uri (string-append "mirror://cpan/authors/id/C/CH/CHRISN/"
683 "Net-SSLeay-" version ".tar.gz"))
686 "1pfgh4h3szcpvqlcimc60pjbk9zwls99x5863sva0wc47i4dl010"))))
687 (build-system perl-build-system)
688 (inputs `(("openssl" ,openssl)))
691 (modify-phases %standard-phases
693 'configure 'set-ssl-prefix
694 (lambda* (#:key inputs #:allow-other-keys)
695 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
697 (synopsis "Perl extension for using OpenSSL")
699 "This module offers some high level convenience functions for accessing
700 web pages on SSL servers (for symmetry, the same API is offered for accessing
701 http servers, too), an sslcat() function for writing your own clients, and
702 finally access to the SSL api of the SSLeay/OpenSSL package so you can write
703 servers or clients for more complicated applications.")
704 (license license:perl-license)
705 (home-page "https://metacpan.org/release/Net-SSLeay")))
707 (define-public perl-crypt-openssl-rsa
709 (name "perl-crypt-openssl-rsa")
715 "mirror://cpan/authors/id/T/TO/TODDR/Crypt-OpenSSL-RSA-"
720 "0djl5i6kibl7862b6ih29q8dhg5zpwzq77q9j8hp6xngshx40ws1"))))
721 (build-system perl-build-system)
723 `(("perl-crypt-openssl-guess" ,perl-crypt-openssl-guess)))
725 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
726 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
727 ("openssl" ,openssl)))
728 (arguments perl-crypt-arguments)
730 "https://metacpan.org/release/Crypt-OpenSSL-RSA")
732 "RSA encoding and decoding, using the openSSL libraries")
733 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
734 OpenSSL libraries).")
735 (license license:perl-license)))
737 (define perl-crypt-arguments
738 `(#:phases (modify-phases %standard-phases
739 (add-before 'configure 'patch-Makefile.PL
740 (lambda* (#:key inputs #:allow-other-keys)
741 (substitute* "Makefile.PL"
742 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
743 (assoc-ref inputs "openssl")
744 "/lib -lcrypto'],")))
747 (define-public perl-crypt-openssl-bignum
749 (name "perl-crypt-openssl-bignum")
755 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
760 "1p22znbajq91lbk2k3yg12ig7hy5b4vy8igxwqkmbm4nhgxp4ki3"))))
761 (build-system perl-build-system)
762 (inputs `(("openssl" ,openssl)))
763 (arguments perl-crypt-arguments)
765 "https://metacpan.org/release/Crypt-OpenSSL-Bignum")
767 "OpenSSL's multiprecision integer arithmetic in Perl")
768 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
769 arithmetic in Perl.")
770 ;; At your option either gpl1+ or the Artistic License
771 (license license:perl-license)))
773 (define-public perl-crypt-openssl-guess
775 (name "perl-crypt-openssl-guess")
781 "mirror://cpan/authors/id/A/AK/AKIYM/Crypt-OpenSSL-Guess-"
785 "0rvi9l4ljcbhwwvspq019nfq2h2v746dk355h2nwnlmqikiihsxa"))))
786 (build-system perl-build-system)
787 (home-page "https://metacpan.org/release/Crypt-OpenSSL-Guess")
788 (synopsis "Guess the OpenSSL include path")
790 "The Crypt::OpenSSL::Guess Perl module provides helpers to guess the
791 correct OpenSSL include path. It is intended for use in your
792 @file{Makefile.PL}.")
793 (license license:perl-license)))
795 (define-public perl-crypt-openssl-random
797 (name "perl-crypt-openssl-random")
803 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
807 (base32 "1x6ffps8q7mnawmcfq740llzy7i10g3319vap0wiw4d33fm6z1zh"))))
808 (build-system perl-build-system)
810 `(("perl-crypt-openssl-guess" ,perl-crypt-openssl-guess)))
812 `(("openssl" ,openssl)))
813 (arguments perl-crypt-arguments)
815 "https://metacpan.org/release/Crypt-OpenSSL-Random")
817 "OpenSSL/LibreSSL pseudo-random number generator access")
818 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
820 (license license:perl-license)))
822 (define-public acme-client
828 (uri (string-append "https://kristaps.bsd.lv/" name "/"
829 "snapshots/" name "-portable-"
833 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
834 (build-system gnu-build-system)
836 '(#:tests? #f ; no test suite
839 (string-append "PREFIX=" (assoc-ref %outputs "out")))
841 (modify-phases %standard-phases
842 (add-after 'unpack 'patch-paths
843 (lambda* (#:key inputs #:allow-other-keys)
844 (let ((pem (string-append (assoc-ref inputs "libressl")
845 "/etc/ssl/cert.pem")))
846 (substitute* "http.c"
847 (("/etc/ssl/cert.pem") pem))
849 (delete 'configure)))) ; no './configure' script
851 `(("pkg-config" ,pkg-config)))
854 ("libressl" ,libressl)))
855 (synopsis "Let's Encrypt client by the OpenBSD project")
856 (description "acme-client is a Let's Encrypt client implemented in C. It
857 uses a modular design, and attempts to secure itself by dropping privileges and
858 operating in a chroot where possible. acme-client is developed on OpenBSD and
859 then ported to the GNU / Linux environment.")
860 (home-page "https://kristaps.bsd.lv/acme-client/")
861 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
862 ;; and 'jsmn.c' are distributed under the Expat license.
863 (license (list license:isc license:expat))))
865 ;; The "-apache" variant is the upstreamed prefered variant. A "-gpl"
866 ;; variant exists in addition to the "-apache" one.
867 (define-public mbedtls-apache
869 (name "mbedtls-apache")
874 ;; XXX: The download links on the website are script redirection links
875 ;; which effectively lead to the format listed in the uri here.
876 (uri (string-append "https://tls.mbed.org/download/mbedtls-"
877 version "-apache.tgz"))
880 "0qd65lnr63vmx2gxla6lcmm5gawlnaj4wy4h4vmdc3h9h9nyw6zc"))))
881 (build-system cmake-build-system)
884 (list "-DUSE_SHARED_MBEDTLS_LIBRARY=ON")))
888 (synopsis "Small TLS library")
890 "@code{mbed TLS}, formerly known as PolarSSL, makes it trivially easy
891 for developers to include cryptographic and SSL/TLS capabilities in their
892 (embedded) products, facilitating this functionality with a minimal
894 (home-page "https://tls.mbed.org")
895 (license license:asl2.0)))
897 ;; The Hiawatha Web server requires some specific features to be enabled.
898 (define-public mbedtls-for-hiawatha
901 (inherit mbedtls-apache)
903 (substitute-keyword-arguments
905 (modify-phases %standard-phases
906 (add-after 'configure 'configure-extra-features
908 (for-each (lambda (feature)
909 (invoke "scripts/config.pl" "set" feature))
910 (list "MBEDTLS_THREADING_C"
911 "MBEDTLS_THREADING_PTHREAD"))
913 ,@(package-arguments mbedtls-apache)))))))
915 (define-public dehydrated
922 "https://github.com/lukas2511/dehydrated/releases/download/"
923 "v" version "/dehydrated-" version ".tar.gz"))
926 "0dgskgbdd95p13jx6s13p77y15wngb5cm6p4305cf2s54w0bvahh"))))
927 (build-system trivial-build-system)
929 `(#:modules ((guix build utils))
932 (use-modules (guix build utils))
933 (let* ((source (assoc-ref %build-inputs "source"))
934 (tar (assoc-ref %build-inputs "tar"))
935 (gz (assoc-ref %build-inputs "gzip"))
936 (out (assoc-ref %outputs "out"))
937 (bin (string-append out "/bin"))
938 (doc (string-append out "/share/doc/"))
939 (bash (in-vicinity (assoc-ref %build-inputs "bash") "bin")))
941 (setenv "PATH" (string-append gz "/bin"))
942 (invoke (string-append tar "/bin/tar") "xvf" source)
943 (chdir (string-append ,name "-" ,version))
945 (install-file "dehydrated" bin)
946 (install-file "LICENSE" (string-append doc ,name "-" ,version))
947 (with-directory-excursion bin
948 (patch-shebang "dehydrated" (list bash))
950 ;; Do not try to write in the store.
951 (substitute* "dehydrated"
952 (("SCRIPTDIR=\"\\$.*\"") "SCRIPTDIR=~/.dehydrated"))
955 (wrap-program "dehydrated"
958 (string-append dir "/bin"))
960 (assoc-ref %build-inputs input))
971 ("coreutils" ,coreutils)
973 ("diffutils" ,diffutils)
981 (home-page "https://dehydrated.io/")
982 (synopsis "Let's Encrypt/ACME client implemented as a shell script")
983 (description "Dehydrated is a client for signing certificates with an
984 ACME-server (currently only provided by Let's Encrypt) implemented as a
985 relatively simple Bash script.")
986 (license license:expat)))
988 (define-public go-github-com-certifi-gocertifi
989 (let ((commit "d2eda712971317d7dd278bc2a52acda7e945f97e")
992 (name "go-github-com-certifi-gocertifi")
993 (version (git-version "2018.01.18" revision commit))
997 (url "https://github.com/certifi/gocertifi")
999 (file-name (git-file-name name version))
1002 "0f3v26xps7gadw4qfmh1kxbpgp0cgqdd61a257xnnvnd7ll6k8dh"))))
1003 (build-system go-build-system)
1005 '(#:import-path "github.com/certifi/gocertifi"))
1006 (synopsis "X.509 TLS root certificate bundle for Go")
1007 (description "This package is a Go language X.509 TLS root certificate bundle,
1008 derived from Mozilla's collection.")
1009 (home-page "https://certifi.io")
1010 (license license:mpl2.0))))