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
09a7af8c
Commit
09a7af8c
authored
Feb 19, 2016
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: Wait as long as possible to create ACME client at startup (fixes #617)
parent
ecf913e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
caddy/https/https.go
caddy/https/https.go
+14
-4
No files found.
caddy/https/https.go
View file @
09a7af8c
...
...
@@ -117,16 +117,26 @@ func ObtainCerts(configs []server.Config, allowPrompts, proxyACME bool) error {
groupedConfigs
:=
groupConfigsByEmail
(
configs
,
allowPrompts
)
for
email
,
group
:=
range
groupedConfigs
{
client
,
err
:=
NewACMEClient
(
email
,
allowPrompts
)
if
err
!=
nil
{
return
errors
.
New
(
"error creating client: "
+
err
.
Error
())
}
// Wait as long as we can before creating the client, because it
// may not be needed, for example, if we already have what we
// need on disk. Creating a client involves the network and
// potentially prompting the user, etc., so only do if necessary.
var
client
*
ACMEClient
for
_
,
cfg
:=
range
group
{
if
cfg
.
Host
==
""
||
existingCertAndKey
(
cfg
.
Host
)
{
continue
}
// Now we definitely do need a client
if
client
==
nil
{
var
err
error
client
,
err
=
NewACMEClient
(
email
,
allowPrompts
)
if
err
!=
nil
{
return
errors
.
New
(
"error creating client: "
+
err
.
Error
())
}
}
// c.Configure assumes that allowPrompts == !proxyACME,
// but that's not always true. For example, a restart where
// the user isn't present and we're not listening on port 80.
...
...
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