-
Notifications
You must be signed in to change notification settings - Fork 721
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
docs(s2n-tls-hyper): Add hyper client/server example #5069
Open
goatgoose
wants to merge
4
commits into
aws:main
Choose a base branch
from
goatgoose:hyper-example
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.
+295
−60
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIB3DCCAWKgAwIBAgIUaAjZTaFhJNRyFtFQut1CdrY7RH0wCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjQwMTI3MDAwODQ4WhgP | ||
MjIwMzA3MDQwMDA4NDhaMBwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQDDARyb290MHYw | ||
EAYHKoZIzj0CAQYFK4EEACIDYgAEclmOmfFLoQR+mupZSc7J3IfZ6OV0IphUHWwv | ||
iH9BvkGh4OX+RZfafa4hw90A5fk0ps520Dt04tHwotLBNkdQcWDJunOhw8ydebIP | ||
TaP0V8OgxFs+P4kpBkMVNB3H+PK6o2MwYTAdBgNVHQ4EFgQU2ic6pZKpiyOr5aPt | ||
YhABB9hJC5QwHwYDVR0jBBgwFoAU2ic6pZKpiyOr5aPtYhABB9hJC5QwDwYDVR0T | ||
AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAgQwCgYIKoZIzj0EAwMDaAAwZQIxAMtZ | ||
+QqC0LGdqUxdr2woMr6pUNAaZYaxm6APPqyKsjVqNaKadiSueNbbbc+seKJXbwIw | ||
Zl0HNHzmoNAMkpgx5BCukjL1v07C571diSW4Z/P96t8tUzi/2rUOoFlJYU0B8cib | ||
MIIB2zCCAWKgAwIBAgIUFGw6MYghVw9GrlpnQwZUmB0HHbwwCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjUwMTI4MjEyNDU2WhgP | ||
MjIwNDA3MDUyMTI0NTZaMBwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQDDARyb290MHYw | ||
EAYHKoZIzj0CAQYFK4EEACIDYgAEAzmebLd0GPptVlLK68gdNVVxmzTqI/ppHwYs | ||
rn8D+0yUvD2SZj8Pkxq+Ow/gVK16CC2pY9o24xagYRhJ9RUgIrocC9k0c61QquXq | ||
Sz58dWyajw5/gBGFxryWlaoRiC4uo2MwYTAdBgNVHQ4EFgQUSvDRw0hufm/4UxQS | ||
m97QrxknijwwHwYDVR0jBBgwFoAUSvDRw0hufm/4UxQSm97QrxknijwwDwYDVR0T | ||
AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAgQwCgYIKoZIzj0EAwMDZwAwZAIwCnoD | ||
mXfz4EZaUBZpfKbYBg6GxdGbpURJkWD4TaYK75JqWSYsQNZQQpCOOBG5zjcGAjAl | ||
i5bAyEtIJW33HzZUuCpZpc6rhFLv97b4HIRdDd1kgSMYBwUfi371de/H24vuC/s= | ||
-----END CERTIFICATE----- |
This file contains 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 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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIB3TCCAWKgAwIBAgIUJhUgxiGTEOtg0JBtu9SrS7PPvo0wCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjQwMTI3MDAwODQ4WhgP | ||
MjIwMzA3MDQwMDA4NDhaMCAxCzAJBgNVBAYTAlVTMREwDwYDVQQDDAhrYW5nYXJv | ||
bzB2MBAGByqGSM49AgEGBSuBBAAiA2IABCzesg6GHI5tMP4JuMvpiVHsc+CStyTy | ||
JQQZ4jyj4fVfgqCcPVo6qJq6DjPepMRkm5tLtFrdavl8/ZZpiCi5vLSymUxliFXD | ||
9DD8GO5naaBnW2EmuYCcNrB0FJJfKZurVKNfMF0wGwYDVR0RBBQwEoIQd3d3Lmth | ||
bmdhcm9vLmNvbTAdBgNVHQ4EFgQUNmsIZH0IDGVlSy7V6BYZTE6NX1QwHwYDVR0j | ||
BBgwFoAU2ic6pZKpiyOr5aPtYhABB9hJC5QwCgYIKoZIzj0EAwMDaQAwZgIxAJzE | ||
GC8hKsqTmDxI4r7bewI/vjtKyEUf0BDJfRrSLixPySYRTbx950iHMo6kXB0DEwIx | ||
AO02gaF9weybuklR+DZ/j6EEZk4HlaRvN575vKmdDYIUF4KpFcT/8f85+5klj9Tl | ||
Hg== | ||
MIIB3TCCAWKgAwIBAgIUIbygx2K+SoQizZPmr+WpBYAyC+UwCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjUwMTI4MjEyNDU2WhgP | ||
MjIwNDA3MDUyMTI0NTZaMCAxCzAJBgNVBAYTAlVTMREwDwYDVQQDDAhrYW5nYXJv | ||
bzB2MBAGByqGSM49AgEGBSuBBAAiA2I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NAaZYaxm6APPqyKsjVqNaKadiSueNbbbc+seKJXbwIw | ||
Zl0HNHzmoNAMkpgx5BCukjL1v07C571diSW4Z/P96t8tUzi/2rUOoFlJYU0B8cib | ||
MIIB2zCCAWKgAwIBAgIUFGw6MYghVw9GrlpnQwZUmB0HHbwwCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjUwMTI4MjEyNDU2WhgP | ||
MjIwNDA3MDUyMTI0NTZaMBwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQDDARyb290MHYw | ||
EAYHKoZIzj0CAQYFK4EEACIDYgAEAzmebLd0GPptVlLK68gdNVVxmzTqI/ppHwYs | ||
rn8D+0yUvD2SZj8Pkxq+Ow/gVK16CC2pY9o24xagYRhJ9RUgIrocC9k0c61QquXq | ||
Sz58dWyajw5/gBGFxryWlaoRiC4uo2MwYTAdBgNVHQ4EFgQUSvDRw0hufm/4UxQS | ||
m97QrxknijwwHwYDVR0jBBgwFoAUSvDRw0hufm/4UxQSm97QrxknijwwDwYDVR0T | ||
AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAgQwCgYIKoZIzj0EAwMDZwAwZAIwCnoD | ||
mXfz4EZaUBZpfKbYBg6GxdGbpURJkWD4TaYK75JqWSYsQNZQQpCOOBG5zjcGAjAl | ||
i5bAyEtIJW33HzZUuCpZpc6rhFLv97b4HIRdDd1kgSMYBwUfi371de/H24vuC/s= | ||
-----END CERTIFICATE----- |
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDB8OJA0z/nzPkogIasW | ||
B8xhhROb0sDbHEqYwStAdDKEWGCLGyy46/5sMprtht8bBpahZANiAAQs3rIOhhyO | ||
bTD+CbjL6YlR7HPgkrck8iUEGeI8o+H1X4KgnD1aOqiaug4z3qTEZJubS7Ra3Wr5 | ||
fP2WaYgouby0splMZYhVw/Qw/BjuZ2mgZ1thJrmAnDawdBSSXymbq1Q= | ||
MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDDQb27I4N/bli1Akl+n | ||
t2jd6CEXwqQbpcgD9lgEXBYigObKYfXb08UNZDC3HH4VVNahZANiAASS+236DAnU | ||
Z5K/X/jjGLWaaCdd4YRh/CaknQ0Bksv0n8BKPAG5gxBerXNxxpAqcdPytUOZRDbI | ||
X7esvt5+EJ/KvvbsuGiP3Pn5vBRym6KHu+PJ8MXR6PhnM5cycD0dyPY= | ||
-----END PRIVATE KEY----- |
This file contains 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,24 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIB1TCCAVygAwIBAgIUIbygx2K+SoQizZPmr+WpBYAyC+YwCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjUwMTI4MjEyNDU2WhgP | ||
MjIwNDA3MDUyMTI0NTZaMCExCzAJBgNVBAYTAlVTMRIwEAYDVQQDDAlsb2NhbGhv | ||
c3QwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAR2LB4AO/2VunUoHiAtRESZM+by7BGs | ||
T9rYfTfRksznhwhutBT1uEFlCMJdUWt48DYDPiURi8p0Tyeb/eXTtVsvRmXcg99J | ||
Fnih1VZj7EORZxi+ERGnRE26Um+5Ki/UORyjWDBWMBQGA1UdEQQNMAuCCWxvY2Fs | ||
aG9zdDAdBgNVHQ4EFgQUEcK0db2ctmhGC17lC0irWUAeVDEwHwYDVR0jBBgwFoAU | ||
SvDRw0hufm/4UxQSm97QrxknijwwCgYIKoZIzj0EAwMDZwAwZAIwMp8U0i0Ibwyk | ||
JOWyY3ZC36xMask8C9jomulEikG96+6fJpGywxDc40ZIqTD0ze74AjBWF10vPSZh | ||
mW6WtIZ0Xf4yRxXb9EY6+LMWbQMHVkE2ec5+WEvfUFf72bGUTWPKWSw= | ||
-----END CERTIFICATE----- | ||
-----BEGIN CERTIFICATE----- | ||
MIIB2zCCAWKgAwIBAgIUFGw6MYghVw9GrlpnQwZUmB0HHbwwCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjUwMTI4MjEyNDU2WhgP | ||
MjIwNDA3MDUyMTI0NTZaMBwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQDDARyb290MHYw | ||
EAYHKoZIzj0CAQYFK4EEACIDYgAEAzmebLd0GPptVlLK68gdNVVxmzTqI/ppHwYs | ||
rn8D+0yUvD2SZj8Pkxq+Ow/gVK16CC2pY9o24xagYRhJ9RUgIrocC9k0c61QquXq | ||
Sz58dWyajw5/gBGFxryWlaoRiC4uo2MwYTAdBgNVHQ4EFgQUSvDRw0hufm/4UxQS | ||
m97QrxknijwwHwYDVR0jBBgwFoAUSvDRw0hufm/4UxQSm97QrxknijwwDwYDVR0T | ||
AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAgQwCgYIKoZIzj0EAwMDZwAwZAIwCnoD | ||
mXfz4EZaUBZpfKbYBg6GxdGbpURJkWD4TaYK75JqWSYsQNZQQpCOOBG5zjcGAjAl | ||
i5bAyEtIJW33HzZUuCpZpc6rhFLv97b4HIRdDd1kgSMYBwUfi371de/H24vuC/s= | ||
-----END CERTIFICATE----- |
This file contains 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,6 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDDnJ1xbUHAxZthbja8u | ||
7QZBCRQg+/lsKjZzswdK9EW6gzlL+RLg5JsMNAEHJgbRZcihZANiAAR2LB4AO/2V | ||
unUoHiAtRESZM+by7BGsT9rYfTfRksznhwhutBT1uEFlCMJdUWt48DYDPiURi8p0 | ||
Tyeb/eXTtVsvRmXcg99JFnih1VZj7EORZxi+ERGnRE26Um+5Ki/UORw= | ||
-----END PRIVATE KEY----- |
This file contains 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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIB2DCCAV6gAwIBAgIUJhUgxiGTEOtg0JBtu9SrS7PPvowwCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjQwMTI3MDAwODQ4WhgP | ||
MjIwMzA3MDQwMDA4NDhaMB4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQDDAZ3b21iYXQw | ||
djAQBgcqhkjOPQIBBgUrgQQAIgNiAARUye9Qgw5N7T8nk6DFoUwPVzSnQy9v4v0V | ||
8SOUZmRwBqmFSJ9Vm988BwAcPFHdmQ13Za4XTkDbQvMmgzntIIIziiyaJQAazRFG | ||
Y2Ex4V/YBiIsuh5wPOXjtvOtgVMXBgijXTBbMBkGA1UdEQQSMBCCDnd3dy53b21i | ||
YXQuY29tMB0GA1UdDgQWBBS+Tbl0gagSNimLM5q2EgeBIMEAfzAfBgNVHSMEGDAW | ||
gBTaJzqlkqmLI6vlo+1iEAEH2EkLlDAKBggqhkjOPQQDAwNoADBlAjAKqbrvk9by | ||
G278VLs7F8uvc1mFYYWv/ZnnQIEJT8srO+P57PtC5FBId5oK28P41EUCMQCim4LR | ||
KzY/PcdY8NlAcHu/caWvGH2+FWm7jFyr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DJunOhw8ydebIP | ||
TaP0V8OgxFs+P4kpBkMVNB3H+PK6o2MwYTAdBgNVHQ4EFgQU2ic6pZKpiyOr5aPt | ||
YhABB9hJC5QwHwYDVR0jBBgwFoAU2ic6pZKpiyOr5aPtYhABB9hJC5QwDwYDVR0T | ||
AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAgQwCgYIKoZIzj0EAwMDaAAwZQIxAMtZ | ||
+QqC0LGdqUxdr2woMr6pUNAaZYaxm6APPqyKsjVqNaKadiSueNbbbc+seKJXbwIw | ||
Zl0HNHzmoNAMkpgx5BCukjL1v07C571diSW4Z/P96t8tUzi/2rUOoFlJYU0B8cib | ||
MIIB2zCCAWKgAwIBAgIUFGw6MYghVw9GrlpnQwZUmB0HHbwwCgYIKoZIzj0EAwMw | ||
HDELMAkGA1UEBhMCVVMxDTALBgNVBAMMBHJvb3QwIBcNMjUwMTI4MjEyNDU2WhgP | ||
MjIwNDA3MDUyMTI0NTZaMBwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQDDARyb290MHYw | ||
EAYHKoZIzj0CAQYFK4EEACIDYgAEAzmebLd0GPptVlLK68gdNVVxmzTqI/ppHwYs | ||
rn8D+0yUvD2SZj8Pkxq+Ow/gVK16CC2pY9o24xagYRhJ9RUgIrocC9k0c61QquXq | ||
Sz58dWyajw5/gBGFxryWlaoRiC4uo2MwYTAdBgNVHQ4EFgQUSvDRw0hufm/4UxQS | ||
m97QrxknijwwHwYDVR0jBBgwFoAUSvDRw0hufm/4UxQSm97QrxknijwwDwYDVR0T | ||
AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAgQwCgYIKoZIzj0EAwMDZwAwZAIwCnoD | ||
mXfz4EZaUBZpfKbYBg6GxdGbpURJkWD4TaYK75JqWSYsQNZQQpCOOBG5zjcGAjAl | ||
i5bAyEtIJW33HzZUuCpZpc6rhFLv97b4HIRdDd1kgSMYBwUfi371de/H24vuC/s= | ||
-----END CERTIFICATE----- |
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDDO2TkDRDnGfKAvjH9+ | ||
SliejJgLp6ONEdNAgfimOEDWgfMJiyYEPp9WhZkASDVTaB2hZANiAARUye9Qgw5N | ||
7T8nk6DFoUwPVzSnQy9v4v0V8SOUZmRwBqmFSJ9Vm988BwAcPFHdmQ13Za4XTkDb | ||
QvMmgzntIIIziiyaJQAazRFGY2Ex4V/YBiIsuh5wPOXjtvOtgVMXBgg= | ||
MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDCKRIdzyeIA/FHH3W4p | ||
ZsAyrZJgeJSwwAksPKP2gSzCfgk0xMETNLix0+2wwDfrFOChZANiAAS+0VxsqVGq | ||
GA00CH7TNweWiBQCo8077bxmYL67K1IbKUL9A7/E0QvpXKX+ZL5avFf+Xuq73Ywj | ||
HDluvciNfyYp7S2GOa9bB3YjX1O6VWye3LP2IPqDRPfrECsULfZ47rE= | ||
-----END PRIVATE KEY----- |
This file contains 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,19 @@ | ||
[package] | ||
name = "hyper-server-client" | ||
version.workspace = true | ||
authors.workspace = true | ||
publish.workspace = true | ||
license.workspace = true | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
s2n-tls = { path = "../../rust/extended/s2n-tls" } | ||
s2n-tls-tokio = { path = "../../rust/extended/s2n-tls-tokio" } | ||
s2n-tls-hyper = { path = "../../rust/standard/s2n-tls-hyper" } | ||
tokio = { version = "1", features = ["full"] } | ||
hyper = { version = "1" } | ||
hyper-util = { version = "0.1", features = ["client-legacy", "server", "tokio", "http1", "http2"]} | ||
http-body-util = { version = "0.1" } | ||
clap = { version = "4", features = ["derive"]} | ||
http = { version = "1" } | ||
bytes = { version = "1" } |
This file contains 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,20 @@ | ||
This example demonstrates how to use s2n-tls with the [hyper](https://hyper.rs/) HTTP library. | ||
|
||
The server example demonstrates how to use s2n-tls with the [hyper-util server](https://docs.rs/hyper-util/latest/hyper_util/server/conn/auto/struct.Builder.html). The client example demonstrates how to use s2n-tls with the [hyper-util client](https://docs.rs/hyper-util/latest/hyper_util/client/legacy/struct.Builder.html), via the [s2n-tls-hyper](../../rust/standard/s2n-tls-hyper) compatibility crate. | ||
|
||
Start the example server as follows: | ||
``` | ||
cargo run --bin server | ||
``` | ||
|
||
The server will listen for incoming TLS connections, and echo the contents of HTTP requests back to the client in an HTTP response. | ||
|
||
Connect to the server with the example client as follows: | ||
``` | ||
cargo run --bin client -- --body "some text to send to the server" | ||
``` | ||
|
||
The example client simply sends a GET request to the server, and can be configured to use a different server address: | ||
``` | ||
cargo run --bin client -- --addr www.amazon.com | ||
``` |
60 changes: 60 additions & 0 deletions
60
bindings/rust-examples/hyper-server-client/src/bin/client.rs
This file contains 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,60 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use bytes::Bytes; | ||
use clap::Parser; | ||
use http_body_util::{BodyExt, Full}; | ||
use hyper_util::{client::legacy::Client, rt::TokioExecutor}; | ||
use std::error::Error; | ||
use std::str::FromStr; | ||
|
||
/// NOTE: this CA is to be used for demonstration purposes only! | ||
const CA: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/../certs/ca-cert.pem")); | ||
|
||
#[derive(Parser)] | ||
struct Args { | ||
#[clap(short, long, default_value = "localhost:1142")] | ||
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, mostly curious: Why 1142? I'm not sure that's a random choice I've seen before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the last part of my phone number :D |
||
addr: String, | ||
#[clap(short, long, default_value = "")] | ||
body: String, | ||
} | ||
|
||
async fn run_client(addr: &str, request_body: Vec<u8>) -> Result<(), Box<dyn Error>> { | ||
// Configure the s2n-tls client. | ||
let config = { | ||
let mut builder = s2n_tls::config::Builder::new(); | ||
builder.trust_pem(CA)?; | ||
builder.build()? | ||
}; | ||
|
||
// Create a hyper-util client with this configuration, using the s2n-tls-hyper HttpsConnector. | ||
let connector = s2n_tls_hyper::connector::HttpsConnector::new(config); | ||
let client: Client<_, Full<Bytes>> = Client::builder(TokioExecutor::new()).build(connector); | ||
|
||
// Create an HTTP request to send to the server. | ||
let uri = http::Uri::from_str(format!("https://{addr}/").as_str())?; | ||
let request: http::Request<Full<Bytes>> = http::Request::builder() | ||
.method(http::Method::GET) | ||
.uri(uri) | ||
.body(Full::from(request_body.clone()))?; | ||
|
||
// Send the request to the server. | ||
let response = client.request(request).await?; | ||
assert_eq!(response.status(), http::StatusCode::OK); | ||
|
||
// Get the response body. | ||
let response_body = response.into_body().collect().await?.to_bytes(); | ||
println!( | ||
"Response body: \n{}", | ||
String::from_utf8_lossy(&response_body) | ||
); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn Error>> { | ||
let args = Args::parse(); | ||
run_client(&args.addr, args.body.into_bytes()).await?; | ||
Ok(()) | ||
} |
Oops, something went wrong.
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.
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.
Could I run the client without the server? Like
cargo run --bin client -- --addr "google.com"
?Right now I think it'd fail because of no echo, but should it maybe just print the response or something instead or asserting the response?
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.
Yes, it'd work on other servers too! That makes sense, I'll remove the assertion.
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.
I confirmed that it works by testing amazon.com. 🤔