Browse Source

Add documentation and support for Red Hat openssl directories

Dick Marinus 8 years ago
parent
commit
403848e855
2 changed files with 6 additions and 1 deletions
  1. 3 0
      tests/README.md
  2. 3 1
      tests/monkey.py

+ 3 - 0
tests/README.md

@@ -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,