Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4fcd5eab
Commit
4fcd5eab
authored
Feb 15, 2017
by
Roman Vynar
Committed by
Carl Bergquist
Feb 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add advanced TLS settings to harden setup. (#7347)
* Hardcoded the most secured TLS options.
parent
902cf5f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletions
+27
-1
pkg/api/http_server.go
+27
-1
No files found.
pkg/api/http_server.go
View file @
4fcd5eab
...
...
@@ -2,6 +2,7 @@ package api
import
(
"context"
"crypto/tls"
"errors"
"fmt"
"net/http"
...
...
@@ -75,7 +76,32 @@ func (hs *HttpServer) listenAndServeTLS(listenAddr, certfile, keyfile string) er
return
fmt
.
Errorf
(
`Cannot find SSL key_file at %v`
,
setting
.
KeyFile
)
}
return
http
.
ListenAndServeTLS
(
listenAddr
,
setting
.
CertFile
,
setting
.
KeyFile
,
hs
.
macaron
)
tlsCfg
:=
&
tls
.
Config
{
MinVersion
:
tls
.
VersionTLS12
,
PreferServerCipherSuites
:
true
,
CipherSuites
:
[]
uint16
{
tls
.
TLS_RSA_WITH_AES_128_CBC_SHA
,
tls
.
TLS_RSA_WITH_AES_256_CBC_SHA
,
tls
.
TLS_RSA_WITH_AES_128_GCM_SHA256
,
tls
.
TLS_RSA_WITH_AES_256_GCM_SHA384
,
tls
.
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
,
tls
.
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
,
tls
.
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
,
tls
.
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
,
tls
.
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
,
tls
.
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
,
tls
.
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
,
tls
.
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
,
},
}
srv
:=
&
http
.
Server
{
Addr
:
listenAddr
,
Handler
:
hs
.
macaron
,
TLSConfig
:
tlsCfg
,
TLSNextProto
:
make
(
map
[
string
]
func
(
*
http
.
Server
,
*
tls
.
Conn
,
http
.
Handler
),
0
),
}
return
srv
.
ListenAndServeTLS
(
setting
.
CertFile
,
setting
.
KeyFile
)
}
func
(
hs
*
HttpServer
)
newMacaron
()
*
macaron
.
Macaron
{
...
...
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