-
Notifications
You must be signed in to change notification settings - Fork 172
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 enco…
…ded (#577)
- Loading branch information
Showing
10 changed files
with
250 additions
and
26 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
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
Oops, something went wrong.