Skip to content
Merged
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
3 changes: 3 additions & 0 deletions app-libs/oracle/src/certificates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manually check certificate hierarchy for the exact domain the teeracle will query.
Find the root CA and add its PEM to this directory and then provide it in
`root_certificates_content()` in `oracle_sources`.
13 changes: 13 additions & 0 deletions app-libs/oracle/src/certificates/google-trust-services-r4.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE-----
MIICCTCCAY6gAwIBAgINAgPlwGjvYxqccpBQUjAKBggqhkjOPQQDAzBHMQswCQYD
VQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIG
A1UEAxMLR1RTIFJvb3QgUjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAw
WjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2Vz
IExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcqhkjOPQIBBgUrgQQAIgNi
AATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa6zzuhXyi
QHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/lxKvR
HYqjQjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW
BBSATNbrdP9JNqPV2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNpADBmAjEA6ED/g94D
9J+uHXqnLrmvT/aDHQ4thQEd0dlq7A/Cr8deVl5c1RxYIigL9zC2L7F8AjEA8GE8
p/SgguMh1YQdc4acLa/KNJvxn7kjNuK8YAOdgLOaVsjh4rsUecrNIdSUtUlD
-----END CERTIFICATE-----
11 changes: 3 additions & 8 deletions app-libs/oracle/src/oracle_sources/coin_gecko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ const COINGECKO_PARAM_CURRENCY: &str = "vs_currency";
const COINGECKO_PARAM_COIN: &str = "ids";
const COINGECKO_PATH: &str = "api/v3/coins/markets";
const COINGECKO_TIMEOUT: Duration = Duration::from_secs(20u64);
const COINGECKO_ROOT_CERTIFICATE_BALTIMORE: &str =
include_str!("../certificates/baltimore_cyber_trust_root_v3.pem");
const COINGECKO_ROOT_CERTIFICATE_LETSENCRYPT: &str =
include_str!("../certificates/lets_encrypt_root_cert.pem");
const COINGECKO_ROOT_CERTIFICATE_GTS: &str =
include_str!("../certificates/google-trust-services-r4.pem");

lazy_static! {
static ref SYMBOL_ID_MAP: HashMap<&'static str, &'static str> = HashMap::from([
Expand Down Expand Up @@ -88,10 +86,7 @@ impl<OracleSourceInfo: Into<TradingInfo>> OracleSource<OracleSourceInfo> for Coi
}

fn root_certificates_content(&self) -> Vec<String> {
vec![
COINGECKO_ROOT_CERTIFICATE_LETSENCRYPT.to_string(),
COINGECKO_ROOT_CERTIFICATE_BALTIMORE.to_string(),
]
vec![COINGECKO_ROOT_CERTIFICATE_GTS.to_string()]
}

fn execute_request(
Expand Down
Loading