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
2bcbdd6a
Commit
2bcbdd6a
authored
Jan 12, 2016
by
Matthew Holt
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'getcertificate'
parents
e283af4d
8f2196c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
caddy/letsencrypt/letsencrypt.go
caddy/letsencrypt/letsencrypt.go
+12
-8
caddy/setup/tls.go
caddy/setup/tls.go
+7
-0
No files found.
caddy/letsencrypt/letsencrypt.go
View file @
2bcbdd6a
...
...
@@ -342,9 +342,11 @@ func newClientPort(leEmail, port string) (*acme.Client, error) {
if
err
!=
nil
{
return
nil
,
err
}
if
port
!=
""
{
client
.
SetHTTPAddress
(
":"
+
port
)
client
.
SetTLSAddress
(
":"
+
port
)
client
.
ExcludeChallenges
([]
string
{
"tls-sni-01"
,
"dns-01"
})
// We can only guarantee http-01 at this time
}
client
.
ExcludeChallenges
([]
string
{
"tls-sni-01"
,
"dns-01"
})
// We can only guarantee http-01 at this time, but tls-01 should work if port is not custom!
// If not registered, the user must register an account with the CA
// and agree to terms
...
...
@@ -355,12 +357,14 @@ func newClientPort(leEmail, port string) (*acme.Client, error) {
}
leUser
.
Registration
=
reg
if
port
==
""
{
// can't prompt a user who isn't there
if
!
Agreed
&&
reg
.
TosURL
==
""
{
Agreed
=
promptUserAgreement
(
saURL
,
false
)
// TODO - latest URL
}
if
!
Agreed
&&
reg
.
TosURL
==
""
{
return
nil
,
errors
.
New
(
"user must agree to terms"
)
}
}
err
=
client
.
AgreeToTOS
()
if
err
!=
nil
{
...
...
caddy/setup/tls.go
View file @
2bcbdd6a
...
...
@@ -34,7 +34,9 @@ func TLS(c *Controller) (middleware.Middleware, error) {
}
// Optional block with extra parameters
var
hadBlock
bool
for
c
.
NextBlock
()
{
hadBlock
=
true
switch
c
.
Val
()
{
case
"protocols"
:
args
:=
c
.
RemainingArgs
()
...
...
@@ -71,6 +73,11 @@ func TLS(c *Controller) (middleware.Middleware, error) {
return
nil
,
c
.
Errf
(
"Unknown keyword '%s'"
,
c
.
Val
())
}
}
// tls requires at least one argument if a block is not opened
if
len
(
args
)
==
0
&&
!
hadBlock
{
return
nil
,
c
.
ArgErr
()
}
}
SetDefaultTLSParams
(
c
.
Config
)
...
...
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