Skip to content

Commit

Permalink
fix: fix TLS loading
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Nov 6, 2024
1 parent 72b13b6 commit 94dd23b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ic_tee_nitro_gateway/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,26 +270,30 @@ async fn serve() -> Result<()> {
ns: namespace.clone(),
user_owned: false,
subject: Some(principal),
key: SETTING_KEY_TLS.as_bytes().to_vec().into(),
key: COSE_SECRET_PERMANENT_KEY.as_bytes().to_vec().into(),
version: 0,
})
.await
.map_err(anyhow::Error::msg)?;
log::info!(target: "server",
elapsed = start.elapsed().as_millis() as u64;
"tee_agent get_cose_secret for tls");

let setting = tee_agent
.get_cose_setting(SettingPath {
ns: namespace.clone(),
user_owned: false,
subject: Some(principal),
key: COSE_SECRET_PERMANENT_KEY.as_bytes().to_vec().into(),
key: SETTING_KEY_TLS.as_bytes().to_vec().into(),
version: 0,
})
.await
.map_err(anyhow::Error::msg)?;
let tls = decrypt_tls(setting, secret).map_err(anyhow::Error::msg)?;
log::info!(target: "server",
elapsed = start.elapsed().as_millis() as u64;
"tee_agent get tls");
"tee_agent get_cose_setting for tls");

let tls = decrypt_tls(setting, secret).map_err(anyhow::Error::msg)?;
let app = Router::new()
.route(
"/.well-known/information",
Expand Down

0 comments on commit 94dd23b

Please sign in to comment.