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

Add support for HTTPS and H2C app protocols #420

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ItalyPaleAle
Copy link
Contributor

This PR adds support to create a service that uses HTTPS (incl. HTTP/2) or H2C (HTTP/2 Cleartext). Using HTTP/2 should offer significant performance improvements, for example due to support for multiplexing.

  1. New method http.NewServiceWithOptions which allows creating a service with options, including configuring the protocol explicitly ("https", "http", "h2c") and passing TLS certificates
  2. If the env var APP_PROTOCOL (see Inject APP_PROTOCOL in app containers dapr#6512 and Add APP_PROTOCOL env var for app cli#1318) is present, uses that to detect HTTPS or H2C usage
  3. If app protocol is HTTPS and no TLS certificates are passed, generates a self-signed cert automatically (they have validity of 1 year, but the expiration doesn't matter because Dapr doesn't validate TLS certificates)

Signed-off-by: ItalyPaleAle <[email protected]>
Signed-off-by: ItalyPaleAle <[email protected]>
@ItalyPaleAle ItalyPaleAle requested a review from a team as a code owner June 15, 2023 19:23
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Patch coverage: 29.87% and project coverage change: -1.11% ⚠️

Comparison is base (5a105f0) 69.17% compared to head (c449cea) 68.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
- Coverage   69.17%   68.07%   -1.11%     
==========================================
  Files          34       34              
  Lines        2735     2800      +65     
==========================================
+ Hits         1892     1906      +14     
- Misses        734      784      +50     
- Partials      109      110       +1     
Files Changed Coverage Δ
service/http/service.go 43.11% <29.87%> (-31.89%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daixiang0
Copy link
Member

wait for related PRs merged.

@daixiang0 daixiang0 added the do-not-merge do-not-merge label Jul 10, 2023
@ItalyPaleAle
Copy link
Contributor Author

wait for related PRs merged.

Which PR? The runtime features are merged

@ItalyPaleAle ItalyPaleAle reopened this Aug 7, 2023
@yaron2
Copy link
Member

yaron2 commented Sep 14, 2023

validation isn't passing.

@ItalyPaleAle
Copy link
Contributor Author

Can you re-trigger it please? It's been a while since it ran

@yaron2
Copy link
Member

yaron2 commented Sep 14, 2023

Doesn't seem to be a way to re-trigger.. i'll reopen.

@yaron2 yaron2 closed this Sep 14, 2023
@yaron2 yaron2 reopened this Sep 14, 2023
@ItalyPaleAle
Copy link
Contributor Author

Uhm I don't understand what's causing the tests to fail. Everything is working fine, but the failure is here:

https://github.com/ItalyPaleAle/dapr-go-sdk/blob/c449ceace2cc2a7520e411bb1ad04531d9b755f9/examples/service/README.md#L167

Which is trying to kill a process and it fails, after having already stopped Dapr?

(lsof -i:8080 | grep main) | awk '{print $2}' | xargs  kill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge do-not-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants