-
Notifications
You must be signed in to change notification settings - Fork 11
docs: add how-to guide for configuring the backend protocol #601
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
Open
Thanhphan1147
wants to merge
5
commits into
main
Choose a base branch
from
docs-configure-backend-protocol
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+51
−1
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
68092e0
docs: add how-to guide for configuring the backend protocol
Thanhphan1147 7555137
Merge branch 'main' into docs-configure-backend-protocol
erinecon 4e7a170
Update docs/how-to/configure-backend-protocol.md
Thanhphan1147 eeb73f3
Update docs/how-to/configure-backend-protocol.md
Thanhphan1147 f6e2fa3
docs: address review comments on configure-backend-protocol guide
Thanhphan1147 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Thanhphan1147 marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| myst: | ||
| html_meta: | ||
| "description lang=en": "Learn about how to configure the backend protocol to use HTTPS for connections." | ||
| --- | ||
|
|
||
| (how_to_configure_backend_protocol)= | ||
|
Thanhphan1147 marked this conversation as resolved.
|
||
|
|
||
| # How to set the protocol to HTTPS for a backend application | ||
|
|
||
| By default, the HAProxy charm enforces HTTPS for connections from clients while communicating with backend applications over HTTP. In some scenarios, you may also want to use HTTPS as the communication protocol for connections between HAProxy and the backend applications. | ||
|
|
||
| To do so, HAProxy verifies the identity of the backend application against a set of trusted certificate authority (CA) certificates. These certificates are sent to the `haproxy` charm through the `receive-ca-certs` relation. Therefore, at least one `receive-ca-certs` relation is required before you can set the backend protocol to HTTPS. | ||
|
|
||
| This guide assumes that you have already deployed the `haproxy` charm and integrated it with a `haproxy-route` requirer. In this guide we use the [`ingress-configurator`](https://charmhub.io/ingress-configurator) charm as the requirer. | ||
|
|
||
| ## Transfer the CA certificate of the backend application | ||
|
|
||
| Integrate the charm that provides the backend CA certificate with the `haproxy` charm through the `receive-ca-certs` relation. In this guide we use the `self-signed-certificates` charm as an example: | ||
|
|
||
| ```sh | ||
| juju integrate haproxy:receive-ca-certs self-signed-certificates | ||
| ``` | ||
|
|
||
| Verify that the CA certificate has been transferred and written to the expected location on the HAProxy unit: | ||
|
|
||
| ```sh | ||
| juju ssh haproxy/leader ls /var/lib/haproxy/cas | ||
| ``` | ||
|
|
||
| You should see the `cas.pem` file listed in the output. | ||
|
|
||
| ## Configure the backend protocol | ||
|
|
||
| Set the `backend-protocol` configuration on the `ingress-configurator` charm to `https`: | ||
|
|
||
| ```sh | ||
| juju config ingress-configurator backend-protocol=https | ||
| ``` | ||
|
|
||
| Once all charms have settled into an "Active" state, HAProxy establishes HTTPS connections to the backend application and verifies its identity using the transferred CA certificate. | ||
|
|
||
| ## Verify the backend protocol | ||
|
|
||
| Send a request through HAProxy and confirm that you can still reach the backend application, and that the backend application is now terminating TLS. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.