Skip to content

Commit 938d343

Browse files
authored
Merge pull request #278 from pennam/wifi-ssl-docs-fix
WiFiS3: WiFiWebClientSSL fix information about CA Root certificate
2 parents 2f4f5d5 + 1d6ec03 commit 938d343

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Diff for: libraries/WiFiS3/examples/WiFiWebClientSSL/WiFiWebClientSSL.ino

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
22
TLS WiFi Web client
33
4-
Remember to update the CA certificates using CertificateUploader sketch
5-
before using this sketch.
4+
Board CA Root certificate bundle is embedded inside WiFi firmware:
5+
https://github.com/arduino/uno-r4-wifi-usb-bridge/blob/main/certificates/cacrt_all.pem
66
77
Find the full UNO R4 WiFi Network documentation here:
88
https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#wi-fi-web-client-ssl
@@ -12,7 +12,7 @@
1212
#include "WiFiSSLClient.h"
1313
#include "IPAddress.h"
1414

15-
#include "arduino_secrets.h"
15+
#include "arduino_secrets.h"
1616

1717
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
1818
char ssid[] = SECRET_SSID; // your network SSID (name)
@@ -31,41 +31,41 @@ WiFiSSLClient client;
3131

3232
/* -------------------------------------------------------------------------- */
3333
void setup() {
34-
/* -------------------------------------------------------------------------- */
34+
/* -------------------------------------------------------------------------- */
3535
//Initialize serial and wait for port to open:
3636
Serial.begin(115200);
3737
while (!Serial) {
3838
; // wait for serial port to connect. Needed for native USB port only
3939
}
40-
40+
4141
// check for the WiFi module:
4242
if (WiFi.status() == WL_NO_MODULE) {
4343
Serial.println("Communication with WiFi module failed!");
4444
// don't continue
4545
while (true);
4646
}
47-
47+
4848
String fv = WiFi.firmwareVersion();
4949
if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
5050
Serial.println("Please upgrade the firmware");
5151
}
52-
52+
5353
// attempt to connect to WiFi network:
5454
while (status != WL_CONNECTED) {
5555
Serial.print("Attempting to connect to SSID: ");
5656
Serial.println(ssid);
5757
// Connect to WPA/WPA2 network.
5858
status = WiFi.begin(ssid, pass);
59-
59+
6060
// wait 10 seconds for connection:
6161
delay(10000);
6262
}
63-
63+
6464
printWifiStatus();
65-
65+
6666
Serial.println("\nStarting connection to server...");
6767
// if you get a connection, report back via serial:
68-
68+
6969
if (client.connect(server, 443)) {
7070
Serial.println("connected to server");
7171
// Make a HTTP request:
@@ -79,7 +79,7 @@ void setup() {
7979
/* just wrap the received data up to 80 columns in the serial print*/
8080
/* -------------------------------------------------------------------------- */
8181
void read_response() {
82-
/* -------------------------------------------------------------------------- */
82+
/* -------------------------------------------------------------------------- */
8383
uint32_t received_data_num = 0;
8484
while (client.available()) {
8585
/* actual data reception */
@@ -88,15 +88,15 @@ void read_response() {
8888
Serial.print(c);
8989
/* wrap data to 80 columns*/
9090
received_data_num++;
91-
if(received_data_num % 80 == 0) {
91+
if(received_data_num % 80 == 0) {
9292
Serial.println();
9393
}
94-
}
94+
}
9595
}
9696

9797
/* -------------------------------------------------------------------------- */
9898
void loop() {
99-
/* -------------------------------------------------------------------------- */
99+
/* -------------------------------------------------------------------------- */
100100
read_response();
101101

102102
// if the server's disconnected, stop the client:
@@ -112,7 +112,7 @@ void loop() {
112112

113113
/* -------------------------------------------------------------------------- */
114114
void printWifiStatus() {
115-
/* -------------------------------------------------------------------------- */
115+
/* -------------------------------------------------------------------------- */
116116
// print the SSID of the network you're attached to:
117117
Serial.print("SSID: ");
118118
Serial.println(WiFi.SSID());

0 commit comments

Comments
 (0)