Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Connection not working #886

Open
Sumis34 opened this issue Jun 25, 2024 · 1 comment
Open

SSL Connection not working #886

Sumis34 opened this issue Jun 25, 2024 · 1 comment

Comments

@Sumis34
Copy link

Sumis34 commented Jun 25, 2024

I'm using this code her with Aduino IDE in VSCode and a ESP 32. When i try to connect to the Server with SSL it dose not work.

Am I missing something?

void setup() {
    WiFi.mode(WIFI_STA);
    WiFi.setHostname(hostname.c_str());
    Serial.begin(115200);
    WiFiManager wm;

    bool res = wm.autoConnect("Glowb Setup");

    if (!res) {
        Serial.println("Failed to connect");
        // ESP.restart();
    } else {
        // if you get here you have connected to the WiFi
        Serial.println("connected...yeey :)");
    }

    String macAddress = String(ESP.getEfuseMac(), HEX);

    setClock();

    // DEV MODE
    //  ws.begin("192.168.1.127", 5005, "/ws?id=" + macAddress);

    // PROD MODE
    const char* url = ("/ws?id=" + macAddress).c_str();
    ws.beginSSL("example.ch", 443, url, NULL, "");

    // event handler
    ws.onEvent(webSocketEvent);

    // try ever 5000 again if connection has failed
    ws.setReconnectInterval(5000);
}

@la-elias
Copy link

try with ws.beginSSL("example.ch", 443, url);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants