[Build] Fix mDNS builds + failing FEATURE_MQTT_TLS=0 & HTTP_TLS=1

This commit is contained in:
TD-er
2026-03-17 14:04:38 +01:00
parent 5921ea6ed1
commit cc620b15b0
10 changed files with 20 additions and 14 deletions
+2
View File
@@ -91,3 +91,5 @@ src/src/CustomBuild/CompiletimeDefines_generated.h
sdkconfig.normal_ESP32solo1_4M316k
src/Custom_.h
+1 -1
View File
@@ -43,7 +43,7 @@ bool CPlugin_002(CPlugin::Function function, struct EventStruct *event, String&
proto.usesExtCreds = true;
proto.defaultPort = 1883;
proto.usesID = true;
# if FEATURE_MQTT_TLS
#if FEATURE_MQTT_TLS
proto.usesTLS = true;
# endif // if FEATURE_MQTT_TLS
break;
+2 -2
View File
@@ -23,9 +23,9 @@ bool CPlugin_004(CPlugin::Function function, struct EventStruct *event, String&
proto.usesPassword = true;
proto.defaultPort = 80;
proto.usesID = true;
# if FEATURE_HTTP_TLS
#if FEATURE_HTTP_TLS
proto.usesTLS = true;
# endif // if FEATURE_HTTP_TLS
# endif
break;
}
@@ -77,7 +77,7 @@ struct ControllerSettingsStruct
CONTROLLER_HOSTNAME,
CONTROLLER_IP,
CONTROLLER_PORT,
#if FEATURE_MQTT_TLS
#if FEATURE_MQTT_TLS || FEATURE_HTTP_TLS
CONTROLLER_MQTT_TLS_TYPE,
CONTROLLER_MQTT_TLS_STORE_FINGERPRINT,
CONTROLLER_MQTT_TLS_STORE_CERT,
+1 -1
View File
@@ -38,7 +38,7 @@ struct ProtocolStruct
uint32_t needsNetwork : 1;
uint32_t allowsExpire : 1;
uint32_t allowLocalSystemTime : 1;
#if FEATURE_MQTT_TLS
#if FEATURE_MQTT_TLS || FEATURE_HTTP_TLS
uint32_t usesTLS : 1; // May offer TLS related settings and options
#else
uint32_t dontUseBit16 : 1;
+6 -3
View File
@@ -1197,11 +1197,15 @@ void MQTTStatus(struct EventStruct *event, const String& status)
}
}
# if FEATURE_MQTT_TLS
#endif
# if FEATURE_MQTT_TLS || FEATURE_HTTP_TLS
bool GetTLSfingerprint(String& fp)
{
# ifdef ESP32
# if FEATURE_MQTT_TLS
// FIXME TD-er: We need to have a closer look at this as currently FEATURE_HTTP_TLS really needs FEATURE_MQTT_TLS
if (MQTTclient_connected && (mqtt_tls != nullptr)) {
const uint8_t *recv_fingerprint = mqtt_tls->getRecvPubKeyFingerprint();
@@ -1228,6 +1232,7 @@ bool GetTLSfingerprint(String& fp)
return true;
}
}
#endif
# endif // ifdef ESP32
return false;
}
@@ -1254,8 +1259,6 @@ bool GetTLS_Certificate(String& cert, bool caRoot)
# endif // if FEATURE_MQTT_TLS
#endif // if FEATURE_MQTT
/*********************************************************************************************\
* send specific sensor task data, effectively calling PluginCall(PLUGIN_READ...)
\*********************************************************************************************/
+3 -2
View File
@@ -77,15 +77,16 @@ bool MQTTpublish(controllerIndex_t controller_idx, taskIndex_t taskIndex, Strin
* Send status info back to channel where request came from
\*********************************************************************************************/
void MQTTStatus(struct EventStruct *event, const String& status);
#endif //if FEATURE_MQTT
#if FEATURE_MQTT_TLS
# if FEATURE_MQTT_TLS || FEATURE_HTTP_TLS
bool GetTLSfingerprint(String& fp);
bool GetTLS_Certificate(String& cert, bool caRoot);
#endif
#endif //if FEATURE_MQTT
/*********************************************************************************************\
+2 -2
View File
@@ -31,8 +31,8 @@ void update_mDNS() {
if (webserverRunning) {
if (!mDNS_init) {
addLog(LOG_LEVEL_INFO, F("mDNS : Starting mDNS..."));
mDNS_init = MDNS.begin(NetworkGetHostname().c_str());
MDNS.setInstanceName(NetworkGetHostname()); // Needed for when the hostname has changed.
mDNS_init = MDNS.begin(ESPEasy::net::NetworkGetHostname().c_str());
MDNS.setInstanceName(ESPEasy::net::NetworkGetHostname()); // Needed for when the hostname has changed.
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
String log = F("mDNS : ");
+1 -1
View File
@@ -617,7 +617,7 @@ KeyValueStruct getKeyValue(LabelType::Enum label, bool extendedValue)
#if FEATURE_MDNS
case LabelType::M_DNS:
{
const String url = NetworkGetHostname() + F(".local");
const String url = ESPEasy::net::NetworkGetHostname() + F(".local");
if (extendedValue) {
return KeyValueStruct(F("mDNS"),
+1 -1
View File
@@ -141,7 +141,7 @@ void addControllerEnabledForm(controllerIndex_t controllerindex) {
addFormCheckBox(displayName, internalName, Settings.ControllerEnabled[controllerindex]);
}
#if FEATURE_MQTT_TLS
#if FEATURE_MQTT_TLS || FEATURE_HTTP_TLS
void addCertificateFileNote(const ControllerSettingsStruct& ControllerSettings, const String& description, TLS_types tls_type) {
const String certFile = ControllerSettings.getCertificateFilename(tls_type);