Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
cac58eaa
Commit
cac58eaa
authored
Nov 02, 2015
by
xenolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to latest lego changes
parent
9a4e26a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
caddy/letsencrypt/letsencrypt.go
caddy/letsencrypt/letsencrypt.go
+8
-10
No files found.
caddy/letsencrypt/letsencrypt.go
View file @
cac58eaa
...
...
@@ -7,6 +7,7 @@ import (
"encoding/json"
"errors"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
...
...
@@ -83,9 +84,11 @@ func Activate(configs []server.Config) ([]server.Config, error) {
}
// client is ready, so let's get free, trusted SSL certificates! yeah!
certificates
,
err
:=
obtainCertificates
(
client
,
serverConfigs
)
if
err
!=
nil
{
return
configs
,
errors
.
New
(
"error getting certs: "
+
err
.
Error
())
certificates
,
failures
:=
obtainCertificates
(
client
,
serverConfigs
)
if
len
(
failures
)
>
0
{
for
k
,
v
:=
range
failures
{
log
.
Printf
(
"[%s] Failed to get a certificate: %s"
,
k
,
v
)
}
}
// ... that's it. save the certs, keys, and metadata files to disk
...
...
@@ -234,19 +237,14 @@ func newClient(leEmail string) (*acme.Client, error) {
// obtainCertificates obtains certificates from the CA server for
// the configurations in serverConfigs using client.
func
obtainCertificates
(
client
*
acme
.
Client
,
serverConfigs
[]
*
server
.
Config
)
([]
acme
.
CertificateResource
,
error
)
{
func
obtainCertificates
(
client
*
acme
.
Client
,
serverConfigs
[]
*
server
.
Config
)
([]
acme
.
CertificateResource
,
map
[
string
]
error
)
{
// collect all the hostnames into one slice
var
hosts
[]
string
for
_
,
cfg
:=
range
serverConfigs
{
hosts
=
append
(
hosts
,
cfg
.
Host
)
}
certificates
,
err
:=
client
.
ObtainCertificates
(
hosts
,
true
)
if
err
!=
nil
{
return
nil
,
errors
.
New
(
"error obtaining certs: "
+
err
.
Error
())
}
return
certificates
,
nil
return
client
.
ObtainCertificates
(
hosts
,
true
)
}
// saveCertificates saves each certificate resource to disk. This
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment