certapi 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: certapi
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python Package for managing keys, request SSL certificates from ACME.
5
5
  Home-page: https://github.com/mesudip/certapi
6
6
  Author: Sudip Bhattarai
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="certapi",
5
- version="0.2.0",
5
+ version="0.2.2",
6
6
  packages=find_packages(where="src"),
7
7
  package_dir={"": "src"},
8
8
  install_requires=[
@@ -30,11 +30,13 @@ class CertAuthority:
30
30
  key_store: KeyStore,
31
31
  acme_url=None,
32
32
  dns_stores: List[challenge.ChallengeStore] = None,
33
+ self_verify_challenge=False,
33
34
  ):
34
35
  self.acme = Acme(key_store.account_key, url=acme_url)
35
36
  self.key_store = key_store
36
37
  self.challengesStore: challenge.ChallengeStore = challenge_store
37
38
  self.dns_stores = dns_stores if dns_stores is not None else []
39
+ self.self_verify_challenge = self_verify_challenge
38
40
 
39
41
  def setup(self):
40
42
  self.acme.setup()
@@ -93,7 +95,8 @@ class CertAuthority:
93
95
  time.sleep(10)
94
96
 
95
97
  for c in challenges:
96
- # c.self_verify()
98
+ if self.self_verify_challenge and not has_wildcard:
99
+ c.self_verify()
97
100
  c.verify(dns=has_wildcard)
98
101
  end = time.time() + 60 # Increase overall timeout
99
102
  source: List[Challenge] = [x for x in challenges]
@@ -141,9 +141,9 @@ class SqliteKeyStore(KeyStore):
141
141
 
142
142
 
143
143
  class FilesystemKeyStore(KeyStore):
144
- def __init__(self, base_dir="."):
145
- self.keys_dir = os.path.join(base_dir, "keys")
146
- self.certs_dir = os.path.join(base_dir, "certs")
144
+ def __init__(self, base_dir=".", keys_dir_name="keys", certs_dir_name="certs"):
145
+ self.keys_dir = os.path.join(base_dir, keys_dir_name)
146
+ self.certs_dir = os.path.join(base_dir, certs_dir_name)
147
147
  os.makedirs(self.keys_dir, exist_ok=True)
148
148
  os.makedirs(self.certs_dir, exist_ok=True)
149
149
  self._init_account_key()
@@ -191,7 +191,11 @@ class FilesystemKeyStore(KeyStore):
191
191
  key_path = os.path.join(self.keys_dir, f"{private_key_id}.key")
192
192
  with open(key_path, "rb") as f:
193
193
  key_content = f.read()
194
+
194
195
  for domain in domains:
196
+ if name is not None and name.endswith(".selfsigned"):
197
+ domain = domain + ".selfsigned"
198
+
195
199
  if domain != private_key_id:
196
200
  with open(os.path.join(self.keys_dir, f"{domain}.key"), "wb") as f:
197
201
  f.write(key_content)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: certapi
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python Package for managing keys, request SSL certificates from ACME.
5
5
  Home-page: https://github.com/mesudip/certapi
6
6
  Author: Sudip Bhattarai
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes