From 93b247c4838f02c94596aceea16267ca7936bce7 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 23 Jan 2015 13:56:57 +0100 Subject: [PATCH] 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 --- letsencrypt/client/CONFIG.py | 4 ++-- letsencrypt/client/network.py | 8 ++++++-- letsencrypt/scripts/main.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/letsencrypt/client/CONFIG.py b/letsencrypt/client/CONFIG.py index 7d0b581fb..e65277221 100644 --- a/letsencrypt/client/CONFIG.py +++ b/letsencrypt/client/CONFIG.py @@ -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 diff --git a/letsencrypt/client/network.py b/letsencrypt/client/network.py index 82c98c363..2ec93136d 100644 --- a/letsencrypt/client/network.py +++ b/letsencrypt/client/network.py @@ -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): diff --git a/letsencrypt/scripts/main.py b/letsencrypt/scripts/main.py index ff3c3c792..c308b55da 100755 --- a/letsencrypt/scripts/main.py +++ b/letsencrypt/scripts/main.py @@ -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.")