Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 44 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions em-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "em-app"
version = "0.5.1"
version = "0.5.2"
authors = ["fortanix.com"]
license = "MPL-2.0"
edition = "2018"
Expand All @@ -11,7 +11,7 @@ keywords = [ "sgx" ]

[dependencies]
b64-ct = "0.1.3"
em-client = { version = "4.0.0", default-features = false, features = ["client"] }
em-client = { version = "4.0.2", default-features = false, features = ["client"] }
em-node-agent-client = "1.0.0"
hyper = { version = "0.10", default-features = false }
mbedtls = { version = ">=0.12.0, <0.14.0", default-features = false, features = ["rdrand", "std", "ssl"] }
Expand Down
14 changes: 11 additions & 3 deletions em-app/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ pub fn get_runtime_configuration(
}

config.push_cert(cert, key).map_err(|e| format!("TLS configuration failed: {:?}", e))?;

let ssl = MbedSSLClient::new_with_sni(Arc::new(config), true, Some(format!("nodes.{}", server)));

let base_path = if sever.starts_with("ccm.") && server.ends_with("fortanix.com") {
format!("nodes.{}", server)
} else {
server.to_owned()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand first branch is for CCM, what the case for this branch?
Other armor services?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed, its for the armor platform.

};


let ssl = MbedSSLClient::new_with_sni(Arc::new(config), true, Some(base_path));
let connector = HttpsConnector::new(ssl);
let client = Client::try_new_with_connector(&format!("https://{}:{}/v1/runtime/app_configs", server, port), None, connector).map_err(|e| format!("EM SaaS request failed: {:?}", e))?;
let mut client = Client::try_new_with_connector(&format!("https://{}:{}", base_path, port), None, connector).map_err(|e| format!("EM SaaS request failed: {:?}", e))?;
client.set_use_new_paths(true);
let response = client.get_runtime_application_config(expected_hash).map_err(|e| format!("Failed requesting workflow config response: {:?}", e))?;

Ok(response)
Expand Down
Loading