Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
720d276f40 |
1 changed files with 4 additions and 4 deletions
|
|
@ -1,9 +1,9 @@
|
|||
diff -up ./acme_tiny.py.chain ./acme_tiny.py
|
||||
--- ./acme_tiny.py.chain 2017-05-16 03:57:46.000000000 -0400
|
||||
+++ ./acme_tiny.py 2017-11-22 12:18:56.963653336 -0500
|
||||
+++ ./acme_tiny.py 2017-11-22 15:14:19.270485351 -0500
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!/usr/bin/python3
|
||||
+#!/usr/bin/python
|
||||
import argparse, subprocess, json, os, sys, base64, binascii, time, hashlib, re, copy, textwrap, logging
|
||||
try:
|
||||
from urllib.request import urlopen # Python 3
|
||||
|
|
@ -73,14 +73,14 @@ diff -up ./acme_tiny.py.chain ./acme_tiny.py
|
|||
+ certchain = [result]
|
||||
+ if chain:
|
||||
+ def parse_link_header(line):
|
||||
+ m = re.search(r"^<([^>]*)>(?:\s*;\s*(.*))?$", line)
|
||||
+ m = re.search(r"^Link:\s*<([^>]*)>(?:\s*;\s*(.*))?\r\n$", line)
|
||||
+ return (m.group(1), dict([(a[0],a[1].strip('"'))
|
||||
+ for a in [attr.split("=")
|
||||
+ for attr in m.group(2).split("\s*;\s*")]]))
|
||||
+
|
||||
+ up = [
|
||||
+ link for link, attr in [
|
||||
+ parse_link_header(l) for l in headers.get_all("Link")
|
||||
+ parse_link_header(l) for l in headers.getallmatchingheaders("Link")
|
||||
+ ] if attr['rel'] == 'up'
|
||||
+ ]
|
||||
+ certchain += [urlopen(url).read() for url in up]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue