mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Updating acme-tiny to 7ef9164, include fixes for OpenSSL 1.1
This commit is contained in:
parent
3f64374f9d
commit
7d36869fe0
1 changed files with 4 additions and 18 deletions
22
src/yunohost/vendor/acme_tiny/acme_tiny.py
vendored
22
src/yunohost/vendor/acme_tiny/acme_tiny.py
vendored
|
@ -1,21 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import subprocess
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import base64
|
||||
import binascii
|
||||
import time
|
||||
import hashlib
|
||||
import re
|
||||
import copy
|
||||
import textwrap
|
||||
import logging
|
||||
import argparse, subprocess, json, os, sys, base64, binascii, time, hashlib, re, copy, textwrap, logging
|
||||
try:
|
||||
from urllib.request import urlopen # Python 3
|
||||
from urllib.request import urlopen # Python 3
|
||||
except ImportError:
|
||||
from urllib2 import urlopen # Python 2
|
||||
from urllib2 import urlopen # Python 2
|
||||
|
||||
#DEFAULT_CA = "https://acme-staging.api.letsencrypt.org"
|
||||
DEFAULT_CA = "https://acme-v01.api.letsencrypt.org"
|
||||
|
@ -24,7 +12,6 @@ LOGGER = logging.getLogger(__name__)
|
|||
LOGGER.addHandler(logging.StreamHandler())
|
||||
LOGGER.setLevel(logging.INFO)
|
||||
|
||||
|
||||
def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA):
|
||||
# helper function base64 encode for jose spec
|
||||
def _b64(b):
|
||||
|
@ -178,7 +165,6 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA):
|
|||
return """-----BEGIN CERTIFICATE-----\n{0}\n-----END CERTIFICATE-----\n""".format(
|
||||
"\n".join(textwrap.wrap(base64.b64encode(result).decode('utf8'), 64)))
|
||||
|
||||
|
||||
def main(argv):
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
|
@ -208,5 +194,5 @@ def main(argv):
|
|||
signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca)
|
||||
sys.stdout.write(signed_crt)
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
main(sys.argv[1:])
|
||||
|
|
Loading…
Add table
Reference in a new issue