mirror of
https://github.com/stakwork/sphinx-key.git
synced 2026-02-23 00:24:18 +01:00
put tls behind feature flag
This commit is contained in:
@@ -63,7 +63,7 @@ then
|
||||
echo "Make sure the ESP is connected with a data USB cable, and try again."
|
||||
exit 1
|
||||
fi
|
||||
esptool.py erase_flash &&
|
||||
# esptool.py erase_flash &&
|
||||
git pull &&
|
||||
cd factory &&
|
||||
cargo espflash flash --release --port $PORT &&
|
||||
|
||||
@@ -10,6 +10,7 @@ default = ["std"]
|
||||
no_persist = []
|
||||
pingpong = []
|
||||
std = ["sphinx-signer"]
|
||||
tls = []
|
||||
|
||||
[dependencies]
|
||||
hex = "0.4.3"
|
||||
|
||||
@@ -24,16 +24,21 @@ pub fn make_client(
|
||||
tx: mpsc::Sender<CoreEvent>,
|
||||
) -> Result<EspMqttClient<ConnState<MessageImpl, EspError>>> {
|
||||
log::info!("make_client with id {}", client_id);
|
||||
let conf = MqttClientConfiguration {
|
||||
let mut conf = MqttClientConfiguration {
|
||||
client_id: Some(client_id),
|
||||
buffer_size: 4096,
|
||||
task_stack: 12288,
|
||||
username: Some(username),
|
||||
password: Some(password),
|
||||
crt_bundle_attach: Some(esp_idf_sys::esp_crt_bundle_attach),
|
||||
// crt_bundle_attach: Some(esp_idf_sys::esp_crt_bundle_attach),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
#[cfg(feature = "tls")]
|
||||
{
|
||||
conf.crt_bundle_attach = Some(esp_idf_sys::esp_crt_bundle_attach);
|
||||
}
|
||||
|
||||
let mut mqtturl = broker.to_string();
|
||||
if !(mqtturl.starts_with("mqtt://") || mqtturl.starts_with("mqtts://")) {
|
||||
let scheme = if mqtturl.contains("8883") {
|
||||
|
||||
Reference in New Issue
Block a user