gnu: gnutls: Remove perl dependency.
[jackhill/guix/guix.git] / gnu / packages / tls.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2016 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 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
9 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
11 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages tls)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix utils)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system perl)
35 #:use-module (guix build-system python)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages guile)
39 #:use-module (gnu packages libbsd)
40 #:use-module (gnu packages libffi)
41 #:use-module (gnu packages libidn)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages ncurses)
44 #:use-module (gnu packages nettle)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages texinfo)
49 #:use-module (gnu packages base)
50 #:use-module (srfi srfi-1))
51
52 (define-public libtasn1
53 (package
54 (name "libtasn1")
55 (version "4.9")
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "mirror://gnu/libtasn1/libtasn1-"
60 version ".tar.gz"))
61 (sha256
62 (base32
63 "0869cp6jx7cajgv6cnddsh3vc7bimmdkdjn80y1jpb4iss7plvsg"))))
64 (build-system gnu-build-system)
65 (native-inputs `(("perl" ,perl)))
66 (home-page "http://www.gnu.org/software/libtasn1/")
67 (synopsis "ASN.1 library")
68 (description
69 "GNU libtasn1 is a library implementing the ASN.1 notation. It is used
70 for transmitting machine-neutral encodings of data objects in computer
71 networking, allowing for formal validation of data according to some
72 specifications.")
73 (license license:lgpl2.0+)))
74
75 (define-public asn1c
76 (package
77 (name "asn1c")
78 (version "0.9.27")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "https://lionet.info/soft/asn1c-"
82 version ".tar.gz"))
83 (sha256
84 (base32
85 "17nvn2kzvlryasr9dzqg6gs27b9lvqpval0k31pb64bjqbhn8pq2"))))
86 (build-system gnu-build-system)
87 (native-inputs
88 `(("perl" ,perl)))
89 (home-page "https://lionet.info/asn1c")
90 (synopsis "ASN.1 to C compiler")
91 (description "The ASN.1 to C compiler takes ASN.1 module
92 files and generates C++ compatible C source code. That code can be
93 used to serialize the native C structures into compact and unambiguous
94 BER/XER/PER-based data files, and deserialize the files back.
95
96 Various ASN.1 based formats are widely used in the industry, such as to encode
97 the X.509 certificates employed in the HTTPS handshake, to exchange control
98 data between mobile phones and cellular networks, to car-to-car communication
99 in intelligent transportation networks.")
100 (license license:bsd-2)))
101
102 (define-public p11-kit
103 (package
104 (name "p11-kit")
105 (version "0.23.2")
106 (source
107 (origin
108 (method url-fetch)
109 (uri (string-append "https://p11-glue.freedesktop.org/releases/p11-kit-"
110 version ".tar.gz"))
111 (sha256
112 (base32
113 "1w7szm190phlkg7qx05ychlj2dbvkgkhx9gw6dx4d5rw62l6wwms"))
114 (modules '((guix build utils))) ; for substitute*
115 (snippet
116 '(begin
117 ;; Drop one test that fails, also when trying to compile manually.
118 ;; Reported upstream at
119 ;; https://bugs.freedesktop.org/show_bug.cgi?id=89027
120 (substitute* "Makefile.in"
121 (("test-module\\$\\(EXEEXT\\) ") ""))))))
122 (build-system gnu-build-system)
123 (native-inputs
124 `(("pkg-config" ,pkg-config)))
125 (inputs
126 `(("libffi" ,libffi)
127 ("libtasn1" ,libtasn1)))
128 (arguments
129 `(#:configure-flags '("--without-trust-paths")))
130 (home-page "http://p11-glue.freedesktop.org/p11-kit.html")
131 (synopsis "PKCS#11 library")
132 (description
133 "p11-kit provides a way to load and enumerate PKCS#11 modules. It
134 provides a standard configuration setup for installing PKCS#11 modules
135 in such a way that they are discoverable. It also solves problems with
136 coordinating the use of PKCS#11 by different components or libraries
137 living in the same process.")
138 (license license:bsd-3)))
139
140 (define-public gnutls
141 (package
142 (name "gnutls")
143 (version "3.5.8")
144 (source (origin
145 (method url-fetch)
146 (uri
147 ;; Note: Releases are no longer on ftp.gnu.org since the
148 ;; schism (after version 3.1.5).
149 (string-append "mirror://gnupg/gnutls/v"
150 (version-major+minor version)
151 "/gnutls-" version ".tar.xz"))
152 (sha256
153 (base32
154 "1zyl2z63s68hx1dpxqx0lykmlf3rwrzlrf44sq3h7dvjmr1z55qf"))))
155 (build-system gnu-build-system)
156 (arguments
157 '(#:configure-flags
158 (list (string-append "--with-guile-site-dir="
159 (assoc-ref %outputs "out")
160 "/share/guile/site/2.0")
161 ;; GnuTLS doesn't consult any environment variables to specify
162 ;; the location of the system-wide trust store. Instead it has a
163 ;; configure-time option. Unless specified, its configure script
164 ;; attempts to auto-detect the location by looking for common
165 ;; places in the file system, none of which are present in our
166 ;; chroot build environment. If not found, then no default trust
167 ;; store is used, so each program has to provide its own
168 ;; fallback, and users have to configure each program
169 ;; independently. This seems suboptimal.
170 "--with-default-trust-store-dir=/etc/ssl/certs"
171
172 ;; FIXME: Temporarily disable p11-kit support since it is not
173 ;; working on mips64el.
174 "--without-p11-kit")
175
176 #:phases (modify-phases %standard-phases
177 (add-after
178 'install 'move-doc
179 (lambda* (#:key outputs #:allow-other-keys)
180 ;; Copy the 4.1 MiB of section 3 man pages to "doc".
181 (let* ((out (assoc-ref outputs "out"))
182 (doc (assoc-ref outputs "doc"))
183 (mandir (string-append doc "/share/man/man3"))
184 (oldman (string-append out "/share/man/man3")))
185 (mkdir-p mandir)
186 (copy-recursively oldman mandir)
187 (delete-file-recursively oldman)
188 #t))))))
189 (outputs '("out" ;4.4 MiB
190 "debug"
191 "doc")) ;4.1 MiB of man pages
192 (native-inputs
193 `(("net-tools" ,net-tools)
194 ("pkg-config" ,pkg-config)
195 ("which" ,which)))
196 (inputs
197 `(("guile" ,guile-2.0)))
198 (propagated-inputs
199 ;; These are all in the 'Requires.private' field of gnutls.pc.
200 `(("libtasn1" ,libtasn1)
201 ("libidn" ,libidn)
202 ("nettle" ,nettle)
203 ("zlib" ,zlib)))
204 (home-page "https://www.gnu.org/software/gnutls/")
205 (synopsis "Transport layer security library")
206 (description
207 "GnuTLS is a secure communications library implementing the SSL, TLS
208 and DTLS protocols. It is provided in the form of a C library to support the
209 protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
210 required structures.")
211 (license license:lgpl2.1+)
212 (properties '((ftp-server . "ftp.gnutls.org")
213 (ftp-directory . "/gcrypt/gnutls")))))
214
215 (define-public gnutls/guile-2.2
216 ;; GnuTLS for Guile 2.2. This is supported by GnuTLS >= 3.5.5.
217 (package
218 (inherit gnutls)
219 (name "guile2.2-gnutls")
220 (arguments
221 ;; Remove '--with-guile-site-dir=…/2.0'.
222 (substitute-keyword-arguments (package-arguments gnutls)
223 ((#:configure-flags flags)
224 `(cdr ,flags))))
225 (inputs `(("guile" ,guile-next)
226 ,@(alist-delete "guile" (package-inputs gnutls))))))
227
228 (define-public openssl
229 (package
230 (name "openssl")
231 (replacement openssl-1.0.2k)
232 (version "1.0.2j")
233 (source (origin
234 (method url-fetch)
235 (uri (list (string-append "ftp://ftp.openssl.org/source/"
236 name "-" version ".tar.gz")
237 (string-append "ftp://ftp.openssl.org/source/old/"
238 (string-trim-right version char-set:letter)
239 "/" name "-" version ".tar.gz")))
240 (sha256
241 (base32
242 "0cf4ar97ijfc7mg35zdgpad6x8ivkdx9qii6mz35khi1ps9g5bz7"))
243 (patches (search-patches "openssl-runpath.patch"
244 "openssl-c-rehash-in.patch"))))
245 (build-system gnu-build-system)
246 (outputs '("out"
247 "doc" ;1.5MiB of man3 pages
248 "static")) ;6MiB of .a files
249 (native-inputs `(("perl" ,perl)))
250 (arguments
251 `(#:disallowed-references (,perl)
252 #:parallel-build? #f
253 #:parallel-tests? #f
254 #:test-target "test"
255
256 ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure,
257 ;; so we explicitly disallow it here.
258 #:disallowed-references ,(list (canonical-package perl))
259 #:phases
260 (modify-phases %standard-phases
261 (add-before
262 'configure 'patch-Makefile.org
263 (lambda* (#:key outputs #:allow-other-keys)
264 ;; The default MANDIR is some unusual place. Fix that.
265 (let ((out (assoc-ref outputs "out")))
266 (patch-makefile-SHELL "Makefile.org")
267 (substitute* "Makefile.org"
268 (("^MANDIR[[:blank:]]*=.*$")
269 (string-append "MANDIR = " out "/share/man\n")))
270 #t)))
271 (replace
272 'configure
273 (lambda* (#:key outputs #:allow-other-keys)
274 (let ((out (assoc-ref outputs "out")))
275 (zero?
276 (system* "./config"
277 "shared" ;build shared libraries
278 "--libdir=lib"
279
280 ;; The default for this catch-all directory is
281 ;; PREFIX/ssl. Change that to something more
282 ;; conventional.
283 (string-append "--openssldir=" out
284 "/share/openssl-" ,version)
285
286 (string-append "--prefix=" out)
287
288 ;; XXX FIXME: Work around a code generation bug in GCC
289 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
290 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
291 ,@(if (and (not (%current-target-system))
292 (string-prefix? "armhf" (%current-system)))
293 '("-mfpu=vfpv3")
294 '()))))))
295 (add-after
296 'install 'make-libraries-writable
297 (lambda* (#:key outputs #:allow-other-keys)
298 ;; Make libraries writable so that 'strip' does its job.
299 (let ((out (assoc-ref outputs "out")))
300 (for-each (lambda (file)
301 (chmod file #o644))
302 (find-files (string-append out "/lib")
303 "\\.so"))
304 #t)))
305 (add-after 'install 'move-static-libraries
306 (lambda* (#:key outputs #:allow-other-keys)
307 ;; Move static libraries to the "static" output.
308 (let* ((out (assoc-ref outputs "out"))
309 (lib (string-append out "/lib"))
310 (static (assoc-ref outputs "static"))
311 (slib (string-append static "/lib")))
312 (for-each (lambda (file)
313 (install-file file slib)
314 (delete-file file))
315 (find-files lib "\\.a$"))
316 #t)))
317 (add-after 'install 'move-man3-pages
318 (lambda* (#:key outputs #:allow-other-keys)
319 ;; Move section 3 man pages to "doc".
320 (let* ((out (assoc-ref outputs "out"))
321 (man3 (string-append out "/share/man/man3"))
322 (doc (assoc-ref outputs "doc"))
323 (target (string-append doc "/share/man/man3")))
324 (mkdir-p target)
325 (for-each (lambda (file)
326 (rename-file file
327 (string-append target "/"
328 (basename file))))
329 (find-files man3))
330 (delete-file-recursively man3)
331 #t)))
332 (add-before
333 'patch-source-shebangs 'patch-tests
334 (lambda* (#:key inputs native-inputs #:allow-other-keys)
335 (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
336 (substitute* (find-files "test" ".*")
337 (("/bin/sh")
338 (string-append bash "/bin/sh"))
339 (("/bin/rm")
340 "rm"))
341 #t)))
342 (add-after
343 'install 'remove-miscellany
344 (lambda* (#:key outputs #:allow-other-keys)
345 ;; The 'misc' directory contains random undocumented shell and Perl
346 ;; scripts. Remove them to avoid retaining a reference on Perl.
347 (let ((out (assoc-ref outputs "out")))
348 (delete-file-recursively (string-append out "/share/openssl-"
349 ,version "/misc"))
350 #t))))))
351 (native-search-paths
352 ;; FIXME: These two variables must designate a single file or directory
353 ;; and are not actually "search paths." In practice it works OK in user
354 ;; profiles because there's always just one item that matches the
355 ;; specification.
356 (list (search-path-specification
357 (variable "SSL_CERT_DIR")
358 (files '("etc/ssl/certs")))
359 (search-path-specification
360 (variable "SSL_CERT_FILE")
361 (files '("etc/ssl/certs/ca-certificates.crt")))))
362 (synopsis "SSL/TLS implementation")
363 (description
364 "OpenSSL is an implementation of SSL/TLS.")
365 (license license:openssl)
366 (home-page "http://www.openssl.org/")))
367
368 (define openssl-1.0.2k
369 (package
370 (inherit openssl)
371 (name "openssl")
372 (version "1.0.2k")
373 (source
374 (origin
375 (method url-fetch)
376 (uri (list (string-append "ftp://ftp.openssl.org/source/"
377 name "-" version ".tar.gz")
378 (string-append "ftp://ftp.openssl.org/source/old/"
379 (string-trim-right version char-set:letter)
380 "/" name "-" version ".tar.gz")))
381 (sha256
382 (base32
383 "1h6qi35w6hv6rd73p4cdgdzg732pdrfgpp37cgwz1v9a3z37ffbb"))
384 (patches (search-patches "openssl-runpath.patch"
385 "openssl-c-rehash-in.patch"))))))
386
387 (define-public openssl-next
388 (package
389 (inherit openssl)
390 (replacement #f)
391 (name "openssl")
392 (version "1.1.0d")
393 (source (origin
394 (method url-fetch)
395 (uri (list (string-append "ftp://ftp.openssl.org/source/"
396 name "-" version ".tar.gz")
397 (string-append "ftp://ftp.openssl.org/source/old/"
398 (string-trim-right version char-set:letter)
399 "/" name "-" version ".tar.gz")))
400 (patches (search-patches "openssl-1.1.0-c-rehash-in.patch"))
401 (sha256
402 (base32
403 "1pv0zql3r73qpjini90hn29l28d65b7i777zav0larbmi6gbnpkx"))))
404 (outputs '("out"
405 "doc" ;1.3MiB of man3 pages
406 "static")) ; 5.5MiB of .a files
407 (arguments
408 (substitute-keyword-arguments (package-arguments openssl)
409 ((#:phases phases)
410 `(modify-phases ,phases
411 (delete 'patch-tests) ; These two phases are not needed by
412 (delete 'patch-Makefile.org) ; OpenSSL 1.1.0.
413
414 ;; Override configure phase since -rpath is now a configure option.
415 (replace 'configure
416 (lambda* (#:key outputs #:allow-other-keys)
417 (let* ((out (assoc-ref outputs "out"))
418 (lib (string-append out "/lib")))
419 (zero?
420 (system* "./config"
421 "shared" ;build shared libraries
422 "--libdir=lib"
423
424 ;; The default for this catch-all directory is
425 ;; PREFIX/ssl. Change that to something more
426 ;; conventional.
427 (string-append "--openssldir=" out
428 "/share/openssl-" ,version)
429
430 (string-append "--prefix=" out)
431 (string-append "-Wl,-rpath," lib)
432
433 ;; XXX FIXME: Work around a code generation bug in GCC
434 ;; 4.9.3 on ARM when compiled with -mfpu=neon. See:
435 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917>
436 ,@(if (and (not (%current-target-system))
437 (string-prefix? "armhf" (%current-system)))
438 '("-mfpu=vfpv3")
439 '()))))))
440
441 ;; XXX: Duplicate this phase to make sure 'version' evaluates
442 ;; in the current scope and not the inherited one.
443 (replace 'remove-miscellany
444 (lambda* (#:key outputs #:allow-other-keys)
445 ;; The 'misc' directory contains random undocumented shell and Perl
446 ;; scripts. Remove them to avoid retaining a reference on Perl.
447 (let ((out (assoc-ref outputs "out")))
448 (delete-file-recursively (string-append out "/share/openssl-"
449 ,version "/misc"))
450 #t)))))))))
451
452 (define-public libressl
453 (package
454 (name "libressl")
455 (version "2.5.0")
456 (source
457 (origin
458 (method url-fetch)
459 (uri (string-append
460 "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-"
461 version ".tar.gz"))
462 (sha256
463 (base32
464 "1bkfvapi4z826slycmicvs7hwgk4l82gd8w6nqvznldbammvyll6"))))
465 (build-system gnu-build-system)
466 (native-search-paths
467 ;; FIXME: These two variables must designate a single file or directory
468 ;; and are not actually "search paths." In practice it works OK in
469 ;; user profiles because there's always just one item that matches the
470 ;; specification.
471 (list (search-path-specification
472 (variable "SSL_CERT_DIR")
473 (files '("etc/ssl/certs")))
474 (search-path-specification
475 (variable "SSL_CERT_FILE")
476 (files '("etc/ssl/certs/ca-certificates.crt")))))
477 (home-page "http://www.libressl.org/")
478 (synopsis "SSL/TLS implementation")
479 (description "LibreSSL is a version of the TLS/crypto stack forked
480 from OpenSSL in 2014, with the goals of modernizing the codebase, improving
481 security, and applying best practice development processes.")
482 ;; Files taken from OpenSSL keep their license, others are under various
483 ;; non-copyleft licenses.
484 (license (list license:openssl
485 (license:non-copyleft
486 "file://COPYING"
487 "See COPYING in the distribution.")))))
488
489 (define-public python-acme
490 (package
491 (name "python-acme")
492 (version "0.10.2")
493 (source (origin
494 (method url-fetch)
495 (uri (pypi-uri "acme" version))
496 (sha256
497 (base32
498 "0y6y8d66yvwdcby96g0dlqqwy72b81yh6hws4va8r7w4aribcrb4"))))
499 (build-system python-build-system)
500 (arguments
501 `(#:phases
502 (modify-phases %standard-phases
503 (add-after 'install 'docs
504 (lambda* (#:key outputs #:allow-other-keys)
505 (let* ((out (assoc-ref outputs "out"))
506 (man (string-append out "/share/man/man1"))
507 (info (string-append out "/info")))
508 (and (zero? (system* "make" "-C" "docs" "man" "info"))
509 (install-file "docs/_build/texinfo/acme-python.info" info)
510 (install-file "docs/_build/man/acme-python.1" man)
511 #t)))))))
512 ;; TODO: Add optional inputs for testing.
513 (native-inputs
514 `(("python-mock" ,python-mock)
515 ;; For documentation
516 ("python-sphinx" ,python-sphinx)
517 ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
518 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
519 ("texinfo" ,texinfo)))
520 (propagated-inputs
521 `(("python-ndg-httpsclient" ,python-ndg-httpsclient)
522 ("python-werkzeug" ,python-werkzeug)
523 ("python-six" ,python-six)
524 ("python-requests" ,python-requests)
525 ("python-pytz" ,python-pytz)
526 ("python-pyrfc3339" ,python-pyrfc3339)
527 ("python-pyasn1" ,python-pyasn1)
528 ("python-cryptography" ,python-cryptography)
529 ("python-pyopenssl" ,python-pyopenssl)))
530 (home-page "https://github.com/letsencrypt/letsencrypt")
531 (synopsis "ACME protocol implementation in Python")
532 (description "ACME protocol implementation in Python")
533 (license license:asl2.0)))
534
535 (define-public python2-acme
536 (package-with-python2 python-acme))
537
538 (define-public certbot
539 (package
540 (name "certbot")
541 (version "0.10.2")
542 (source (origin
543 (method url-fetch)
544 (uri (pypi-uri name version))
545 (sha256
546 (base32
547 "0c8nidbbq8p4rjhcrw31saw04n5rz4zgr08chbch17gw03hrqwik"))))
548 (build-system python-build-system)
549 (arguments
550 `(#:python ,python-2
551 #:phases
552 (modify-phases %standard-phases
553 (add-after 'build 'docs
554 (lambda* (#:key outputs #:allow-other-keys)
555 (let* ((out (assoc-ref outputs "out"))
556 (man1 (string-append out "/share/man/man1"))
557 (man7 (string-append out "/share/man/man7"))
558 (info (string-append out "/info")))
559 (and
560 (zero? (system* "make" "-C" "docs" "man" "info"))
561 (install-file "docs/_build/texinfo/Certbot.info" info)
562 (install-file "docs/_build/man/certbot.1" man1)
563 (install-file "docs/_build/man/certbot.7" man7)
564 #t)))))))
565 ;; TODO: Add optional inputs for testing.
566 (native-inputs
567 `(("python2-nose" ,python2-nose)
568 ("python2-mock" ,python2-mock)
569 ;; For documentation
570 ("python2-sphinx" ,python2-sphinx)
571 ("python2-sphinx-rtd-theme" ,python2-sphinx-rtd-theme)
572 ("python2-sphinx-repoze-autointerface" ,python2-sphinx-repoze-autointerface)
573 ("python2-sphinxcontrib-programoutput" ,python2-sphinxcontrib-programoutput)
574 ("texinfo" ,texinfo)))
575 (propagated-inputs
576 `(("python2-acme" ,python2-acme)
577 ("python2-zope-interface" ,python2-zope-interface)
578 ("python2-pythondialog" ,python2-pythondialog)
579 ("python2-pyrfc3339" ,python2-pyrfc3339)
580 ("python2-pyopenssl" ,python2-pyopenssl)
581 ("python2-configobj" ,python2-configobj)
582 ("python2-configargparse" ,python2-configargparse)
583 ("python2-zope-component" ,python2-zope-component)
584 ("python2-parsedatetime" ,python2-parsedatetime)
585 ("python2-six" ,python2-six)
586 ("python2-psutil" ,python2-psutil)
587 ("python2-requests" ,python2-requests)
588 ("python2-pytz" ,python2-pytz)))
589 (synopsis "Let's Encrypt client by the Electronic Frontier Foundation")
590 (description "Certbot automatically receives and installs X.509 certificates
591 to enable Transport Layer Security (TLS) on servers. It interoperates with the
592 Let’s Encrypt certificate authority (CA), which issues browser-trusted
593 certificates for free.")
594 (home-page "https://certbot.eff.org/")
595 (license license:asl2.0)))
596
597 (define-public letsencrypt
598 (package (inherit certbot)
599 (name "letsencrypt")
600 (properties `((superseded . ,certbot)))))
601
602 (define-public perl-net-ssleay
603 (package
604 (name "perl-net-ssleay")
605 (version "1.68")
606 (source (origin
607 (method url-fetch)
608 (uri (string-append "mirror://cpan/authors/id/M/MI/MIKEM/"
609 "Net-SSLeay-" version ".tar.gz"))
610 (sha256
611 (base32
612 "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p"))))
613 (build-system perl-build-system)
614 (native-inputs
615 `(("patch" ,patch)
616 ("patch/disable-ede-test"
617 ,(search-patch "perl-net-ssleay-disable-ede-test.patch"))))
618 (inputs `(("openssl" ,openssl)))
619 (arguments
620 `(#:phases
621 (modify-phases %standard-phases
622 (add-after
623 'unpack 'apply-patch
624 (lambda* (#:key inputs #:allow-other-keys)
625 ;; XXX We apply this patch here instead of in the 'origin' because
626 ;; this package's build system fails badly when the source file
627 ;; times are zeroed.
628 ;; XXX Try removing this patch for perl-net-ssleay > 1.68
629 (zero? (system* "patch" "--force" "-p1" "-i"
630 (assoc-ref inputs "patch/disable-ede-test")))))
631 (add-before
632 'configure 'set-ssl-prefix
633 (lambda* (#:key inputs #:allow-other-keys)
634 (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
635 #t)))))
636 (synopsis "Perl extension for using OpenSSL")
637 (description
638 "This module offers some high level convenience functions for accessing
639 web pages on SSL servers (for symmetry, the same API is offered for accessing
640 http servers, too), an sslcat() function for writing your own clients, and
641 finally access to the SSL api of the SSLeay/OpenSSL package so you can write
642 servers or clients for more complicated applications.")
643 (license (package-license perl))
644 (home-page "http://search.cpan.org/~mikem/Net-SSLeay-1.66/")))
645
646 (define-public perl-crypt-openssl-rsa
647 (package
648 (name "perl-crypt-openssl-rsa")
649 (version "0.28")
650 (source
651 (origin
652 (method url-fetch)
653 (uri (string-append
654 "mirror://cpan/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-"
655 version
656 ".tar.gz"))
657 (sha256
658 (base32
659 "1gnpvv09b2gpifwdzc5jnhama3d1a4c39lzj9hcaicsb8rvzjmsk"))))
660 (build-system perl-build-system)
661 (inputs
662 `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum)
663 ("perl-crypt-openssl-random" ,perl-crypt-openssl-random)
664 ("openssl" ,openssl)))
665 (arguments perl-crypt-arguments)
666 (home-page
667 "http://search.cpan.org/dist/Crypt-OpenSSL-RSA")
668 (synopsis
669 "RSA encoding and decoding, using the openSSL libraries")
670 (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the
671 OpenSSL libraries).")
672 (license (package-license perl))))
673
674 (define perl-crypt-arguments
675 `(#:phases (modify-phases %standard-phases
676 (add-before 'configure 'patch-Makefile.PL
677 (lambda* (#:key inputs #:allow-other-keys)
678 (substitute* "Makefile.PL"
679 (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
680 (assoc-ref inputs "openssl")
681 "/lib -lcrypto'],")))
682 #t)))))
683
684 (define-public perl-crypt-openssl-bignum
685 (package
686 (name "perl-crypt-openssl-bignum")
687 (version "0.06")
688 (source
689 (origin
690 (method url-fetch)
691 (uri (string-append
692 "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
693 version
694 ".tar.gz"))
695 (sha256
696 (base32
697 "05yzrdglrrzp191krf77zrwfkmzrfwrsrx1vyskbj94522lszk67"))))
698 (build-system perl-build-system)
699 (inputs `(("openssl" ,openssl)))
700 (arguments perl-crypt-arguments)
701 (home-page
702 "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum")
703 (synopsis
704 "OpenSSL's multiprecision integer arithmetic in Perl")
705 (description "Crypt::OpenSSL::Bignum provides multiprecision integer
706 arithmetic in Perl.")
707 ;; At your option either gpl1+ or the Artistic License
708 (license (package-license perl))))
709
710 (define-public perl-crypt-openssl-random
711 (package
712 (name "perl-crypt-openssl-random")
713 (version "0.11")
714 (source
715 (origin
716 (method url-fetch)
717 (uri (string-append
718 "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-"
719 version
720 ".tar.gz"))
721 (sha256
722 (base32
723 "0yjcabkibrkafywvdkmd1xpi6br48skyk3l15ni176wvlg38335v"))))
724 (build-system perl-build-system)
725 (inputs `(("openssl" ,openssl)))
726 (arguments perl-crypt-arguments)
727 (home-page
728 "http://search.cpan.org/dist/Crypt-OpenSSL-Random")
729 (synopsis
730 "OpenSSL/LibreSSL pseudo-random number generator access")
731 (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random
732 number generator")
733 (license (package-license perl))))
734
735 (define-public acme-client
736 (package
737 (name "acme-client")
738 (version "0.1.16")
739 (source (origin
740 (method url-fetch)
741 (uri (string-append "https://kristaps.bsd.lv/" name "/"
742 "snapshots/" name "-portable-"
743 version ".tgz"))
744 (sha256
745 (base32
746 "00q05b3b1dfnfp7sr1nbd212n0mqrycl3cr9lbs51m7ncaihbrz9"))))
747 (build-system gnu-build-system)
748 (arguments
749 '(#:tests? #f ; no test suite
750 #:make-flags
751 (list "CC=gcc"
752 (string-append "PREFIX=" (assoc-ref %outputs "out")))
753 #:phases
754 (modify-phases %standard-phases
755 (add-after 'unpack 'patch-paths
756 (lambda* (#:key inputs #:allow-other-keys)
757 (let ((pem (string-append (assoc-ref inputs "libressl")
758 "/etc/ssl/cert.pem")))
759 (substitute* "http.c"
760 (("/etc/ssl/cert.pem") pem))
761 #t)))
762 (delete 'configure)))) ; no './configure' script
763 (native-inputs
764 `(("pkg-config" ,pkg-config)))
765 (inputs
766 `(("libbsd" ,libbsd)
767 ("libressl" ,libressl)))
768 (synopsis "Let's Encrypt client by the OpenBSD project")
769 (description "acme-client is a Let's Encrypt client implemented in C. It
770 uses a modular design, and attempts to secure itself by dropping privileges and
771 operating in a chroot where possible. acme-client is developed on OpenBSD and
772 then ported to the GNU / Linux environment.")
773 (home-page "https://kristaps.bsd.lv/acme-client/")
774 ;; acme-client is distributed under the ISC license, but the files 'jsmn.h'
775 ;; and 'jsmn.c' are distributed under the Expat license.
776 (license (list license:isc license:expat))))