misc. improvements to ACME servername:port code

changed ACME_SERVER to include the port. this is so the commandline options help will also display the port
and also to make it clear at the constant definition that giving a port is supported there.

improved docstrings
This commit is contained in:
Thomas Waldmann 2015-01-23 13:56:57 +01:00
parent 8070b78e3d
commit 93b247c483
3 changed files with 9 additions and 5 deletions

View file

@ -2,8 +2,8 @@
import os.path
ACME_SERVER = "letsencrypt-demo.org"
"""CA hostname.
ACME_SERVER = "letsencrypt-demo.org:443"
"""CA hostname (and optionally :port).
If you create your own server... change this line

View file

@ -17,11 +17,15 @@ logging.getLogger("requests").setLevel(logging.WARNING)
class Network(object):
"""Class for communicating with ACME servers.
:ivar str server: Certificate authority server (server[:port])
:ivar str server_url: Full URL of the CSR server
:ivar str server_url: Full URL of the ACME service
"""
def __init__(self, server):
"""Initialize Network instance.
:param str server: ACME (CA) server[:port]
"""
self.server_url = "https://%s/acme/" % server
def send(self, msg):

View file

@ -30,7 +30,7 @@ def main():
parser.add_argument("-d", "--domains", dest="domains", metavar="DOMAIN",
nargs="+")
parser.add_argument("-s", "--server", dest="server",
help="The ACME CA server address.")
help="The ACME CA server [%s]." % CONFIG.ACME_SERVER)
parser.add_argument("-p", "--privkey", dest="privkey", type=read_file,
help="Path to the private key file for certificate "
"generation.")