Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
79c499f0
Commit
79c499f0
authored
Aug 18, 2020
by
Brad Davidson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of TLS configuration args
Also fixes an unrelated error formatting issue turned up while testing. Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
e826439e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
server.go
pkg/cli/server/server.go
+12
-8
rootless.go
pkg/rootless/rootless.go
+1
-1
No files found.
pkg/cli/server/server.go
View file @
79c499f0
...
...
@@ -187,18 +187,22 @@ func run(app *cli.Context, cfg *cmds.Server) error {
serverConfig
.
ControlConfig
.
Disables
[
"ccm"
]
=
true
}
TLSMinVersion
:=
getArgValueFromList
(
"tls-min-version"
,
cfg
.
ExtraAPIArgs
)
serverConfig
.
ControlConfig
.
TLSMinVersion
,
err
=
kubeapiserverflag
.
TLSVersion
(
TLSMinVersion
)
tlsMinVersionArg
:=
getArgValueFromList
(
"tls-min-version"
,
cfg
.
ExtraAPIArgs
)
serverConfig
.
ControlConfig
.
TLSMinVersion
,
err
=
kubeapiserverflag
.
TLSVersion
(
tlsMinVersionArg
)
if
err
!=
nil
{
return
errors
.
Wrap
f
(
err
,
"Invalid TLS Version %s: %v"
,
TLSMinVersion
,
err
)
return
errors
.
Wrap
(
err
,
"Invalid tls-min-version"
)
}
// TLS config based on mozilla ssl-config generator
// https://ssl-config.mozilla.org/#server=golang&version=1.13.6&config=intermediate&guideline=5.4
// Need to disable the TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 Cipher for TLS1.2
TLSCipherSuites
:=
[]
string
{
getArgValueFromList
(
"tls-cipher-suites"
,
cfg
.
ExtraAPIArgs
)}
if
len
(
TLSCipherSuites
)
==
0
||
TLSCipherSuites
[
0
]
==
""
{
TLSCipherSuites
=
[]
string
{
tlsCipherSuitesArg
:=
getArgValueFromList
(
"tls-cipher-suites"
,
cfg
.
ExtraAPIArgs
)
tlsCipherSuites
:=
strings
.
Split
(
tlsCipherSuitesArg
,
","
)
for
i
:=
range
tlsCipherSuites
{
tlsCipherSuites
[
i
]
=
strings
.
TrimSpace
(
tlsCipherSuites
[
i
])
}
if
len
(
tlsCipherSuites
)
==
0
||
tlsCipherSuites
[
0
]
==
""
{
tlsCipherSuites
=
[]
string
{
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
,
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
,
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
,
...
...
@@ -207,9 +211,9 @@ func run(app *cli.Context, cfg *cmds.Server) error {
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"
,
}
}
serverConfig
.
ControlConfig
.
TLSCipherSuites
,
err
=
kubeapiserverflag
.
TLSCipherSuites
(
TLS
CipherSuites
)
serverConfig
.
ControlConfig
.
TLSCipherSuites
,
err
=
kubeapiserverflag
.
TLSCipherSuites
(
tls
CipherSuites
)
if
err
!=
nil
{
return
errors
.
Wrap
f
(
err
,
"Invalid TLS Cipher Suites %s: %v"
,
TLSCipherSuites
,
err
)
return
errors
.
Wrap
(
err
,
"Invalid tls-cipher-suites"
)
}
logrus
.
Info
(
"Starting "
+
version
.
Program
+
" "
,
app
.
App
.
Version
)
...
...
pkg/rootless/rootless.go
View file @
79c499f0
...
...
@@ -41,7 +41,7 @@ func Rootless(stateDir string) error {
logrus
.
Fatal
(
err
)
}
if
err
:=
child
.
Child
(
*
childOpt
);
err
!=
nil
{
logrus
.
Fatal
(
"child died
"
,
err
)
logrus
.
Fatal
f
(
"child died: %v
"
,
err
)
}
}
...
...
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