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
492d5aa3
Commit
492d5aa3
authored
Jun 10, 2016
by
Henrique Dias
Committed by
GitHub
Jun 10, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into patch-1
parents
1e4a4109
daa4de57
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
caddyhttp/httpserver/plugin.go
caddyhttp/httpserver/plugin.go
+11
-1
caddytls/certificates.go
caddytls/certificates.go
+3
-0
caddytls/config.go
caddytls/config.go
+1
-1
No files found.
caddyhttp/httpserver/plugin.go
View file @
492d5aa3
...
@@ -115,9 +115,19 @@ func (h *httpContext) MakeServers() ([]caddy.Server, error) {
...
@@ -115,9 +115,19 @@ func (h *httpContext) MakeServers() ([]caddy.Server, error) {
// make sure TLS is disabled for explicitly-HTTP sites
// make sure TLS is disabled for explicitly-HTTP sites
// (necessary when HTTP address shares a block containing tls)
// (necessary when HTTP address shares a block containing tls)
for
_
,
cfg
:=
range
h
.
siteConfigs
{
for
_
,
cfg
:=
range
h
.
siteConfigs
{
if
cfg
.
TLS
.
Enabled
&&
(
cfg
.
Addr
.
Port
==
"80"
||
cfg
.
Addr
.
Scheme
==
"http"
)
{
if
!
cfg
.
TLS
.
Enabled
{
continue
}
if
cfg
.
Addr
.
Port
==
"80"
||
cfg
.
Addr
.
Scheme
==
"http"
{
cfg
.
TLS
.
Enabled
=
false
cfg
.
TLS
.
Enabled
=
false
log
.
Printf
(
"[WARNING] TLS disabled for %s"
,
cfg
.
Addr
)
log
.
Printf
(
"[WARNING] TLS disabled for %s"
,
cfg
.
Addr
)
}
else
if
cfg
.
Addr
.
Scheme
==
""
{
// set scheme to https ourselves, since TLS is enabled
// and it was not explicitly set to something else. this
// makes it appear as "https" when we print the list of
// running sites; otherwise "http" would be assumed which
// is incorrect for this site.
cfg
.
Addr
.
Scheme
=
"https"
}
}
}
}
...
...
caddytls/certificates.go
View file @
492d5aa3
...
@@ -205,6 +205,9 @@ func makeCertificate(certPEMBlock, keyPEMBlock []byte) (Certificate, error) {
...
@@ -205,6 +205,9 @@ func makeCertificate(certPEMBlock, keyPEMBlock []byte) (Certificate, error) {
//
//
// This function is safe for concurrent use.
// This function is safe for concurrent use.
func
cacheCertificate
(
cert
Certificate
)
{
func
cacheCertificate
(
cert
Certificate
)
{
if
cert
.
Config
==
nil
{
cert
.
Config
=
new
(
Config
)
}
certCacheMu
.
Lock
()
certCacheMu
.
Lock
()
if
_
,
ok
:=
certCache
[
""
];
!
ok
{
if
_
,
ok
:=
certCache
[
""
];
!
ok
{
// use as default - must be *appended* to list, or bad things happen!
// use as default - must be *appended* to list, or bad things happen!
...
...
caddytls/config.go
View file @
492d5aa3
...
@@ -17,7 +17,7 @@ type Config struct {
...
@@ -17,7 +17,7 @@ type Config struct {
// The hostname or class of hostnames this config is
// The hostname or class of hostnames this config is
// designated for; can contain wildcard characters
// designated for; can contain wildcard characters
// according to RFC 6125 §6.4.3 - this field MUST
// according to RFC 6125 §6.4.3 - this field MUST
//
NOT be empty in order for things to work smoothly
//
be set in order for things to work as expected
Hostname
string
Hostname
string
// Whether TLS is enabled
// Whether TLS is enabled
...
...
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