Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaiyou <pierre@jaury.eu>2016-11-08 01:22:20 +0300
committerPeter Eckersley <pde@users.noreply.github.com>2016-11-08 01:22:20 +0300
commit82c69815d11a0c947b16be05ff1208363a09b110 (patch)
tree27e561d36a4d206ffb953c6a0891007611a6f71d /certbot-nginx
parent549f0eccf90d71a5a0bc93ce1a01281ad10ace05 (diff)
Fix writing pem files with Python3 (#3757)
* Standardize arguments name for mode and chmod in the util API * Handle OpenSSL pem as bytes objects only for Python3 compatibility * Handle OpenSSL pem as bytes objects only (remaining bits) * Manipulate bytes objects only when testing PEM-related functions * Fix argument order when calling util.unique_file
Diffstat (limited to 'certbot-nginx')
-rw-r--r--certbot-nginx/certbot_nginx/configurator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/certbot-nginx/certbot_nginx/configurator.py b/certbot-nginx/certbot_nginx/configurator.py
index bfc7b6a67..503599423 100644
--- a/certbot-nginx/certbot_nginx/configurator.py
+++ b/certbot-nginx/certbot_nginx/configurator.py
@@ -405,7 +405,8 @@ class NginxConfigurator(common.Plugin):
cert = acme_crypto_util.gen_ss_cert(key, domains=[socket.gethostname()])
cert_pem = OpenSSL.crypto.dump_certificate(
OpenSSL.crypto.FILETYPE_PEM, cert)
- cert_file, cert_path = util.unique_file(os.path.join(tmp_dir, "cert.pem"))
+ cert_file, cert_path = util.unique_file(
+ os.path.join(tmp_dir, "cert.pem"), mode="wb")
with cert_file:
cert_file.write(cert_pem)
return cert_path, le_key.file