-
Notifications
You must be signed in to change notification settings - Fork 20
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
Created secure ESP32 example #12
base: master
Are you sure you want to change the base?
Conversation
Secure ESP32-compatible Pushover example
commented out .setInsercure() as it's not working with ESP32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quality of this request is sadly bad.
Would appreciate it, if it does not break the 8266 and code quality improves.
@@ -44,7 +44,7 @@ void Pushover::setHTML(boolean html) { | |||
boolean Pushover::send(void) { | |||
WiFiClientSecure client; | |||
if (_unsafe) { | |||
client.setInsecure(); | |||
//client.setInsecure(); //not working with ESP32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you commenting out this? Please use preprocessor instructions.
|
||
const char* ssid = ""; // your network SSID (name of wifi network) | ||
const char* password = ""; // your network password | ||
const char* userToken = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If using extra spaces, please align all evenly.
#include <WiFiClientSecure.h> | ||
#include <Pushover.h> | ||
|
||
const char* ssid = ""; // your network SSID (name of wifi network) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why so many spaces?
Serial.print("Attempting to connect to SSID: "); | ||
Serial.println(ssid); | ||
WiFi.begin(ssid, password); | ||
|
||
// attempt to connect to Wifi network: | ||
while (WiFi.status() != WL_CONNECTED) { | ||
Serial.print("."); | ||
// wait 1 second for re-trying | ||
delay(1000); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation
while (WiFi.status() != WL_CONNECTED) delay(50); | ||
Serial.println("Connected"); | ||
client.setCACert(test_root_ca); | ||
Pushover po = Pushover(appToken,userToken, SAFE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAFE can be left out, as it's the default value.
Sorry for the low quality, just wanted to send a working ssl example for possible inclusion and there isn't a great mechanism for just contacting an author. Feel free to reject. Just wanted to put the code out there in case someone found it useful. |
You may improve it by using |
I created a secure ESP32 example. I had to comment out the .setInsecure method as it doesn't appear in the ESP32 version of WiFiClientSecure