refactored SSLClient to use a reference to a client as opposed to an instance.

This commit is contained in:
Noah Laptop 2019-11-07 12:08:39 -08:00
parent 0ca631c627
commit 00f78f18e8
10 changed files with 281 additions and 505 deletions

View file

@ -44,7 +44,8 @@ const int rand_pin = A5;
// Initialize the SSL client library
// We input an EthernetClient, our trust anchors, and the analog pin
// Additionally specify that we want to store 2 sessions since we are connecting to 2 domains
SSLClient<EthernetClient, 2> client(EthernetClient(), TAs, (size_t)TAs_NUM, rand_pin);
EthernetClient base_client;
SSLClient client(base_client, TAs, (size_t)TAs_NUM, rand_pin);
// Variables to measure the speed
unsigned long beginMicros, endMicros;
unsigned long byteCount = 0;
@ -146,8 +147,6 @@ void connectSSL() {
auto start = millis();
if (client.connect(server, 443)) {
auto time = millis() - start;
Serial.print("connected to ");
Serial.println(client.remoteIP());
Serial.print("Took: ");
Serial.println(time);
// Make a HTTP request: