Skip to content
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

Merged
merged 1 commit into from
Jun 30, 2017
Merged

Handle RootCAs certificate #1789

merged 1 commit into from
Jun 30, 2017

Conversation

juliens
Copy link
Member

@juliens juliens commented Jun 27, 2017

Add the possibility to configure self-signed certificate for tls communication with the backends

@juliens juliens force-pushed the feature/rootcas branch 5 times, most recently from 25e4c40 to 029f487 Compare June 27, 2017 13:13
@ldez ldez added this to the 1.4 milestone Jun 27, 2017

// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dep -> r

// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dep -> r

}

// Get return the EntryPoints map
func (dep *RootCAs) Get() interface{} {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dep -> r

}

// SetValue sets the EntryPoints map with val
func (dep *RootCAs) SetValue(val interface{}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dep -> r

}

// Type is type of the struct
func (dep *RootCAs) Type() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dep -> r

err = try.GetRequest("http://127.0.0.1:8081/ping", 1000*time.Millisecond, try.StatusCodeIs(http.StatusOK))

c.Assert(err, checker.IsNil)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this blank line

func (dep *RootCAs) String() string {
sliceOfString := make([]string, len([]FileOrContent(*dep)))
for key, value := range *dep {
sliceOfString[key] = string(value)
Copy link
Contributor

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)

func (f FileOrContent) Read() ([]byte, error) {
var content []byte
if _, err := os.Stat(string(f)); err == nil {
content, err = ioutil.ReadFile(string(f))
Copy link
Contributor

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)

c.Assert(err, checker.IsNil)

err = try.GetRequest("http://127.0.0.1:8081/ping", 1000*time.Millisecond, try.StatusCodeIs(http.StatusOK))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this blank line

c.Assert(err, checker.IsNil)

err = try.GetRequest("http://127.0.0.1:8081/ping", 1000*time.Millisecond, try.StatusCodeIs(http.StatusOK))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this blank line

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job 🎉

LGTM

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@emilevauge emilevauge left a 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continue ?

Copy link
Member

@emilevauge emilevauge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@ldez ldez merged commit 81d011e into traefik:master Jun 30, 2017
@juliens juliens deleted the feature/rootcas branch September 13, 2017 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tls kind/enhancement a new or improved feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants