Skip to content

AES encryption support for softAP mode. #7825

Closed
@itewqq

Description

@itewqq

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12E]
  • Core Version: [latest git hash or date]
  • Development Env: [Arduino IDE]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Nodemcu]
  • Flash Mode: [qio|dio|other]
  • Flash Size: [4MB/1MB]
  • lwip Variant: [v1.4|v2 Lower Memory|Higher Bandwidth]
  • Reset Method: [nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz|160MHz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200]

Problem Description

I've updated my phone to iOS14 and I tried connecting to the soft AP of ESP8266. I had chosen WPA2_PSK as AUTH mode. When I connect my phone, iOS is giving the warning that, WiFi is using WPA2(TKIP) as encryption and suggesting to use WPA2(AES)/WPA3. Since WPA3 is not available for softAP, I'm requesting to support WPA2(AES) for softAP mode.

/*  Exempel på en web server man kan koppla upp sig mot och genom knappar på adressen
 *  192.168.4.1 sätta på och stänga av en LED-lampa ansluten till pin 16 på en ESP8266. 
 */
#include <ESP8266WiFi.h>

WiFiServer server(80); // Initialisera server på port 80.

const char* ssid = "YONO"; //SSID = namn på wifi:et
const char* password = "qushipei"; //Wifi:ets lösenord
int LED_PIN = 16;

void setup(){
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);
  static struct softap_config config;
  WiFi.mode(WIFI_AP); //ESP8266 är en AP (Accesspunkt)
  WiFi.softAP(ssid, password); //ESP8266 accesspunkten får namnet ssid (variabel) och lösenordet password (variabel)
  wifi_softap_get_config(&config);
  config.authmode = AUTH_WPA2_PSK;
  WiFi.begin();
  
  server.begin(); //Start the HTTP server

  //LOOKING UNDER THE HOOD
  Serial.begin(115200); //Starta Seriell kommunikation med ESP8266. Hastighet: 115200
   Serial.println(config.authmode);
  IPAddress HTTPS_ServerIP = WiFi.softAPIP(); //HTTPS_ServerIP = variabel av typen IPAddress
  Serial.printf("Server IP is: "); //Skriv ut ESp8266 IP (IP = datorers personnummer, unik för varje enhet)
  Serial.println(HTTPS_ServerIP);
}

void loop(){
  /* Kolla om någon enhet (klient/client (eng)) är anluten till servern
   * if ansluten - gör något
   * else - kolla igen i all oändlighet
   */
  WiFiClient client = server.available();
    if(!client) {
      return;
    }
    //Looking under the hood
    Serial.println("Browser Online!");

    /* Läs vad webläsaren har skickat som en sträng och skriv ut förfrågan till monitorn. 
     * Read what the browser has sent into a String class and print
       the request to the monitor. */
     String request = client.readStringUntil('/r');
     //Looking under the hood
     Serial.println(request); //skriv serverns förfrågan (request) i den seriella monitorn. Öppnas med Ctrl+shift+m

     //Förbered HTML-koden och lägg till knappar
     String s = "HTTP/1.1 200 OK\r\n";
     s += "Content-Type: text/html\r\n\r\n";
     s += "<!DOCTYPE HTML\r\n<html>\r\n";
     
     //En knapp med namnet b1 av typen input (skickar information). Knappen har Turn LED ON skrivet på sig. Skickar meddelandet i request (förfrågan). 
     s += "<br><input type=\"button\" name=\"b1\" value=\"Turn LED ON\" onclick=\"location.href='/meddelandet'\">";
     
     //3 st nya rader innan nästa knapp
     s += "<br><br><br>";
     
     //En knapp med namnet b1 av typen input (skickar information). Knappen har Turn LED OFF skrivet på sig. Skickar OFF i request (förfrågan). 
     s += "<input type=\"button\" name=\"b1\" value=\"Turn LED OFF\" onclick=\"location.href='/OFF'\">";
     s += "</html>\n";

     if(request.indexOf("/meddelandet") != -1){//Om någon del av request innehåller /meddelandet 
      digitalWrite(LED_PIN, HIGH);             // <-- Så görs detta.
     }
     else if(request.indexOf("/OFF") != -1){//Annars om meddelandet innehållet /OFF
      digitalWrite(LED_PIN,LOW);            // <-- Så görs detta.
     }

     
     client.flush(); //Rensa infon från innan i dataströmmen
     client.print(s); //Skicka HTML dokumentet till webläsaren.
     delay(1);
     Serial.println("Client disconnected");
}

Serial Output Messages

18:53:02.096 -> 3
18:53:02.096 -> Server IP is: 192.168.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions