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

Implement HTTP/HTTPS including permanent redirect #282

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

marcofranssen
Copy link
Contributor

@marcofranssen marcofranssen commented Jun 30, 2023

Resolves #268

Builds on top of #281, so merge that one first to get a cleaner diff here.

  • Refactor http/https server setup to be more transparant

Haven't tested it, because I can't get the docker compile to run on my local. I freezes my entire docker engine till it crashes.

@marcofranssen marcofranssen force-pushed the refactor-http-https branch 5 times, most recently from d24f558 to 9b5a391 Compare June 30, 2023 19:40
Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
@marcofranssen marcofranssen marked this pull request as ready for review June 30, 2023 20:15
// TLS Stack handling
numPorts := 0 // TODO: replace with workerGroup for thread safety
errChannel := make(chan error, 2)
var httpHandler http.Handler = http.HandlerFunc(redirectHTTP)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Permanent redirect to HTTPS.

// log.Printf("HTTP serve error: %v", err)
}()
if serverConfig.HTTPSConfig == nil {
httpHandler = s.GetRouter()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If no https configured, then just let http handle the api requests.

Copy link
Collaborator

@mrsabath mrsabath left a comment

Choose a reason for hiding this comment

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

This one is a really helpful feature. Thank you! LGTM

@mrsabath mrsabath merged commit 1d82509 into spiffe:v1.4 Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend: Enable two ports for HTTP and HTTPS
2 participants