mqttrust_core 0.6.0

MQTT Client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::env;

use native_tls::{Certificate, Identity};

pub fn identity() -> Identity {
    let pw = env::var("DEVICE_ADVISOR_PASSWORD").unwrap();
    Identity::from_pkcs12(include_bytes!("../secrets/identity.pfx"), pw.as_str()).unwrap()
}

pub fn root_ca() -> Certificate {
    Certificate::from_pem(include_bytes!("../secrets/root-ca.pem")).unwrap()
}

pub const HOSTNAME: Option<&'static str> = option_env!("AWS_HOSTNAME");