summaryrefslogtreecommitdiff
path: root/gnu/packages/python-crypto.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-11-28 12:34:18 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-04-07 14:42:20 +0300
commitd020191ed985aabd3d3d4b11fa925877226ed789 (patch)
tree0e837f42cd0f6e23d95ce1d2620f81c5d9fb22c6 /gnu/packages/python-crypto.scm
parent12f02c9bb87b8ea756e5c09806522e6df8b7e1ca (diff)
gnu: python-certifi: Use system SSL certificates.
* gnu/packages/python-crypto.scm (python-certifi)[replacement]: New field. (python-certifi/fixed): Provide a python-certifi which only offers to use the system's SSL certificates. Change-Id: Ie1871be42988dff3cccfe24bca626149fee0f371
Diffstat (limited to 'gnu/packages/python-crypto.scm')
-rw-r--r--gnu/packages/python-crypto.scm36
1 files changed, 36 insertions, 0 deletions
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 3e1472a6c9f..d25059c86b7 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -469,6 +469,7 @@ for example, for recording or replaying web content.")
469 (package 469 (package
470 (name "python-certifi") 470 (name "python-certifi")
471 (version "2022.6.15") 471 (version "2022.6.15")
472 (replacement python-certifi/fixed)
472 (source (origin 473 (source (origin
473 (method url-fetch) 474 (method url-fetch)
474 (uri (pypi-uri "certifi" version)) 475 (uri (pypi-uri "certifi" version))
@@ -484,6 +485,41 @@ for example, for recording or replaying web content.")
484is used by the Requests library to verify HTTPS requests.") 485is used by the Requests library to verify HTTPS requests.")
485 (license license:asl2.0))) 486 (license license:asl2.0)))
486 487
488(define python-certifi/fixed
489 (package
490 (inherit python-certifi)
491 (source (origin
492 (inherit (package-source python-certifi))
493 (snippet
494 #~(begin
495 (delete-file "certifi/cacert.pem")
496 (delete-file "certifi/core.py")
497 (with-output-to-file "certifi/core.py"
498 (lambda _
499 (display "\"\"\"
500certifi.py
501~~~~~~~~~~
502This file is a Guix-specific version of core.py.
503
504This module returns the installation location of SSL_CERT_FILE or
505/etc/ssl/certs/ca-certificates.crt, or its contents.
506\"\"\"
507import os
508
509_CA_CERTS = None
510
511try:
512 _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
513except:
514 _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
515
516def where() -> str:
517 return _CA_CERTS
518
519def contents() -> str:
520 with open(where(), \"r\", encoding=\"ascii\") as data:
521 return data.read()")))))))))
522
487(define-public python-cryptography-vectors 523(define-public python-cryptography-vectors
488 (package 524 (package
489 (name "python-cryptography-vectors") 525 (name "python-cryptography-vectors")