-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle RootCAs certificate #1789
Conversation
25e4c40
to
029f487
Compare
server/configuration.go
Outdated
|
||
// String is the method to format the flag's value, part of the flag.Value interface. | ||
// The String method's output will be used in diagnostics. | ||
func (dep *RootCAs) String() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dep -> r
server/configuration.go
Outdated
// Set is the method to set the flag value, part of the flag.Value interface. | ||
// Set's argument is a string to be parsed to set the flag. | ||
// It's a comma-separated list, so we split it. | ||
func (dep *RootCAs) Set(value string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dep -> r
server/configuration.go
Outdated
} | ||
|
||
// Get return the EntryPoints map | ||
func (dep *RootCAs) Get() interface{} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dep -> r
server/configuration.go
Outdated
} | ||
|
||
// SetValue sets the EntryPoints map with val | ||
func (dep *RootCAs) SetValue(val interface{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dep -> r
server/configuration.go
Outdated
} | ||
|
||
// Type is type of the struct | ||
func (dep *RootCAs) Type() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dep -> r
integration/https_test.go
Outdated
err = try.GetRequest("http://127.0.0.1:8081/ping", 1000*time.Millisecond, try.StatusCodeIs(http.StatusOK)) | ||
|
||
c.Assert(err, checker.IsNil) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this blank line
server/configuration.go
Outdated
func (dep *RootCAs) String() string { | ||
sliceOfString := make([]string, len([]FileOrContent(*dep))) | ||
for key, value := range *dep { | ||
sliceOfString[key] = string(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileOrContent
need to implement Stringer
instead of string(foc)
server/configuration.go
Outdated
func (f FileOrContent) Read() ([]byte, error) { | ||
var content []byte | ||
if _, err := os.Stat(string(f)); err == nil { | ||
content, err = ioutil.ReadFile(string(f)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileOrContent
need to implement Stringer
instead of string(foc)
integration/https_test.go
Outdated
c.Assert(err, checker.IsNil) | ||
|
||
err = try.GetRequest("http://127.0.0.1:8081/ping", 1000*time.Millisecond, try.StatusCodeIs(http.StatusOK)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this blank line
integration/https_test.go
Outdated
c.Assert(err, checker.IsNil) | ||
|
||
err = try.GetRequest("http://127.0.0.1:8081/ping", 1000*time.Millisecond, try.StatusCodeIs(http.StatusOK)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this blank line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job 🎉
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @juliens 👏
One small comment ;)
for _, cert := range globalConfiguration.RootCAs { | ||
certContent, err := cert.Read() | ||
if err != nil { | ||
log.Error("Error while read RootCAs", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continue
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Add the possibility to configure self-signed certificate for tls communication with the backends