diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp index 201b9a3cce..954e003fb5 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp @@ -121,7 +121,7 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase, conf.threshold.authmode = AUTH_OPEN; if(passphrase) { - conf.threshold.authmode = AUTH_WPA_PSK; + conf.threshold.authmode = _useInsecureWEP ? AUTH_WEP : AUTH_WPA_PSK; if (strlen(passphrase) == 64) // it's not a passphrase, is the PSK, which is copied into conf.password without null term memcpy(reinterpret_cast(conf.password), passphrase, 64); else