From a5a28d2e7fc25d89a0e9b3dd9d60e8cbf65e1782 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Mon, 15 Jan 2018 16:05:27 -0500 Subject: [PATCH] Add `/directory` to example `NewClient` caDirURL. (#471) The `acme.NewClient` function's `caDirURL` argument is expected to be the full path to the ACME server's directory endpoint. In the README example of using Lego programmatically against a Boulder instance only the hostname & port are provided but not the directory path: `"http://192.168.99.100:4000"` This produces an error like: ``` 2018/01/15 14:34:06 get directory at 'http://192.168.99.100:4000': invalid character '<' looking for beginning of value ``` When used verbatim with a Boulder container since the `/directory` is missing and "What is an ACME server" HTML index page is returned. This commit updates the example to use: `"http://192.168.99.100:4000/directory"` Which allows the example code to work with Boulder as-intended. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b9c37443..9ec7e1f3 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ myUser := MyUser{ // A client facilitates communication with the CA server. This CA URL is // configured for a local dev instance of Boulder running in Docker in a VM. -client, err := acme.NewClient("http://192.168.99.100:4000", &myUser, acme.RSA2048) +client, err := acme.NewClient("http://192.168.99.100:4000/directory", &myUser, acme.RSA2048) if err != nil { log.Fatal(err) }