Browse Source

Merge remote-tracking branch 'origin/master'

Daniel Roesler 7 years ago
parent
commit
31ff3267b4
4 changed files with 8 additions and 3 deletions
  1. 1 1
      README.md
  2. 3 0
      acme_tiny.py
  3. 3 1
      tests/monkey.py
  4. 1 1
      tests/test_module.py

+ 1 - 1
README.md

@@ -30,7 +30,7 @@ with the corresponding private key. If you don't understand what I just said,
 this script likely isn't for you! Please use the official Let's Encrypt
 this script likely isn't for you! Please use the official Let's Encrypt
 [client](https://github.com/letsencrypt/letsencrypt).
 [client](https://github.com/letsencrypt/letsencrypt).
 To accomplish this you need to initially create a key, that can be used by
 To accomplish this you need to initially create a key, that can be used by
-acme-tiny, to register a account for you and sign all following requests.
+acme-tiny, to register an account for you and sign all following requests.
 
 
 ```
 ```
 openssl genrsa 4096 > account.key
 openssl genrsa 4096 > account.key

+ 3 - 0
acme_tiny.py

@@ -9,6 +9,9 @@ explains how to setup and test acme-tiny yourself.
 1. Make a test subdomain for a server you control. Set it as an environmental
 1. Make a test subdomain for a server you control. Set it as an environmental
 variable on your local test setup.
 variable on your local test setup.
   * On your local: `export TRAVIS_DOMAIN=travis-ci.gethttpsforfree.com`
   * On your local: `export TRAVIS_DOMAIN=travis-ci.gethttpsforfree.com`
+  * Configure the webserver on `$TRAVIS_DOMAIN` for redirection of
+    `http://$TRAVIS_DOMAIN/.well-known/acme-challenge/` to
+    `http://localhost:8888/`
 2. Generate a shared secret between your local test setup and your server.
 2. Generate a shared secret between your local test setup and your server.
   * `openssl rand -base64 32`
   * `openssl rand -base64 32`
   * On your local: `export TRAVIS_SESSION="<random_string_here>"`
   * On your local: `export TRAVIS_SESSION="<random_string_here>"`

+ 3 - 1
tests/monkey.py

@@ -29,7 +29,9 @@ def gen_keys():
     # subject alt-name domain
     # subject alt-name domain
     san_csr = NamedTemporaryFile()
     san_csr = NamedTemporaryFile()
     san_conf = NamedTemporaryFile()
     san_conf = NamedTemporaryFile()
-    san_conf.write(open("/etc/ssl/openssl.cnf").read().encode("utf8"))
+    for openssl_cnf in ['/etc/pki/tls/openssl.cnf', '/etc/ssl/openssl.cnf']:
+        if os.path.exists(openssl_cnf): break
+    san_conf.write(open(openssl_cnf).read().encode("utf8"))
     san_conf.write("\n[SAN]\nsubjectAltName=DNS:{0}\n".format(DOMAIN).encode("utf8"))
     san_conf.write("\n[SAN]\nsubjectAltName=DNS:{0}\n".format(DOMAIN).encode("utf8"))
     san_conf.seek(0)
     san_conf.seek(0)
     Popen(["openssl", "req", "-new", "-sha256", "-key", domain_key.name,
     Popen(["openssl", "req", "-new", "-sha256", "-key", domain_key.name,

+ 1 - 1
tests/test_module.py

@@ -123,7 +123,7 @@ class TestModule(unittest.TestCase):
         self.assertIsInstance(result, ValueError)
         self.assertIsInstance(result, ValueError)
         self.assertIn("Invalid character in DNS name", result.args[0])
         self.assertIn("Invalid character in DNS name", result.args[0])
 
 
-    def test_nonexistant_domain(self):
+    def test_nonexistent_domain(self):
         """ Should be unable verify a nonexistent domain """
         """ Should be unable verify a nonexistent domain """
         try:
         try:
             result = acme_tiny.main([
             result = acme_tiny.main([