-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(575): adding support for inline certificates/keys as base64 encoded
Signed-off-by: gabrik <[email protected]>
- Loading branch information
Showing
9 changed files
with
173 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
use crate::base64_decode; | ||
use crate::{ | ||
config::*, get_quic_addr, verify::WebPkiVerifierAnyServerName, ALPN_QUIC_HTTP, | ||
QUIC_ACCEPT_THROTTLE_TIME, QUIC_DEFAULT_MTU, QUIC_LOCATOR_PREFIX, | ||
|
@@ -246,6 +247,8 @@ impl LinkManagerUnicastTrait for LinkManagerUnicastQuic { | |
// Read the certificates | ||
let f = if let Some(value) = epconf.get(TLS_ROOT_CA_CERTIFICATE_RAW) { | ||
value.as_bytes().to_vec() | ||
} else if let Some(b64_certificate) = epconf.get(TLS_ROOT_CA_CERTIFICATE_BASE64) { | ||
base64_decode(b64_certificate)? | ||
} else if let Some(value) = epconf.get(TLS_ROOT_CA_CERTIFICATE_FILE) { | ||
async_std::fs::read(value) | ||
.await | ||
|
@@ -334,6 +337,8 @@ impl LinkManagerUnicastTrait for LinkManagerUnicastQuic { | |
|
||
let f = if let Some(value) = epconf.get(TLS_SERVER_CERTIFICATE_RAW) { | ||
value.as_bytes().to_vec() | ||
} else if let Some(b64_certificate) = epconf.get(TLS_SERVER_CERTIFICATE_BASE64) { | ||
base64_decode(b64_certificate)? | ||
} else if let Some(value) = epconf.get(TLS_SERVER_CERTIFICATE_FILE) { | ||
async_std::fs::read(value) | ||
.await | ||
|
@@ -350,6 +355,8 @@ impl LinkManagerUnicastTrait for LinkManagerUnicastQuic { | |
// Private keys | ||
let f = if let Some(value) = epconf.get(TLS_SERVER_PRIVATE_KEY_RAW) { | ||
value.as_bytes().to_vec() | ||
} else if let Some(b64_key) = epconf.get(TLS_SERVER_PRIVATE_KEY_BASE64) { | ||
base64_decode(b64_key)? | ||
} else if let Some(value) = epconf.get(TLS_SERVER_PRIVATE_KEY_FILE) { | ||
async_std::fs::read(value) | ||
.await | ||
|
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
Oops, something went wrong.