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
739e4214
Unverified
Commit
739e4214
authored
Jul 31, 2019
by
Erik Wilson
Committed by
GitHub
Jul 31, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #693 from yamt/insecure-bootstrap
Fix bootstrap with non-tls etcd
parents
506d8cdc
d78701ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
bootstrap.go
pkg/daemons/control/bootstrap.go
+5
-1
No files found.
pkg/daemons/control/bootstrap.go
View file @
739e4214
...
@@ -171,7 +171,9 @@ func checkBootstrapArgs(cfg *config.Control, accepted map[string]bool) (bool, er
...
@@ -171,7 +171,9 @@ func checkBootstrapArgs(cfg *config.Control, accepted map[string]bool) (bool, er
}
}
func
genBootstrapTLSConfig
(
cfg
*
config
.
Control
)
(
*
tls
.
Config
,
error
)
{
func
genBootstrapTLSConfig
(
cfg
*
config
.
Control
)
(
*
tls
.
Config
,
error
)
{
tlsConfig
:=
&
tls
.
Config
{}
secureTLSConfig
:=
&
tls
.
Config
{}
// Note: clientv3 excepts nil for non-tls
var
tlsConfig
*
tls
.
Config
if
cfg
.
StorageCertFile
!=
""
&&
cfg
.
StorageKeyFile
!=
""
{
if
cfg
.
StorageCertFile
!=
""
&&
cfg
.
StorageKeyFile
!=
""
{
certPem
,
err
:=
ioutil
.
ReadFile
(
cfg
.
StorageCertFile
)
certPem
,
err
:=
ioutil
.
ReadFile
(
cfg
.
StorageCertFile
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -185,6 +187,7 @@ func genBootstrapTLSConfig(cfg *config.Control) (*tls.Config, error) {
...
@@ -185,6 +187,7 @@ func genBootstrapTLSConfig(cfg *config.Control) (*tls.Config, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
tlsConfig
=
secureTLSConfig
tlsConfig
.
Certificates
=
[]
tls
.
Certificate
{
tlsCert
}
tlsConfig
.
Certificates
=
[]
tls
.
Certificate
{
tlsCert
}
}
}
if
cfg
.
StorageCAFile
!=
""
{
if
cfg
.
StorageCAFile
!=
""
{
...
@@ -194,6 +197,7 @@ func genBootstrapTLSConfig(cfg *config.Control) (*tls.Config, error) {
...
@@ -194,6 +197,7 @@ func genBootstrapTLSConfig(cfg *config.Control) (*tls.Config, error) {
}
}
certPool
:=
x509
.
NewCertPool
()
certPool
:=
x509
.
NewCertPool
()
certPool
.
AppendCertsFromPEM
(
caData
)
certPool
.
AppendCertsFromPEM
(
caData
)
tlsConfig
=
secureTLSConfig
tlsConfig
.
RootCAs
=
certPool
tlsConfig
.
RootCAs
=
certPool
}
}
return
tlsConfig
,
nil
return
tlsConfig
,
nil
...
...
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