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

Adding an additional BearSSL constructor as well as a method setClient to allow late initialisation. #29

Merged
merged 1 commit into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/BearSSLClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
#include "BearSSLClient.h"

BearSSLClient::BearSSLClient(Client& client) :
BearSSLClient(client, TAs, TAs_NUM)
BearSSLClient(&client, TAs, TAs_NUM)
{
}

BearSSLClient::BearSSLClient(Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs) :
_client(&client),
BearSSLClient::BearSSLClient(Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs)
: BearSSLClient(&client, myTAs, myNumTAs)
{
}

BearSSLClient::BearSSLClient(Client* client, const br_x509_trust_anchor* myTAs, int myNumTAs) :
_client(client),
_TAs(myTAs),
_numTAs(myNumTAs),
_noSNI(false)
Expand Down
5 changes: 5 additions & 0 deletions src/BearSSLClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ class BearSSLClient : public Client {
public:
BearSSLClient(Client& client);
BearSSLClient(Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs);
BearSSLClient(Client* client, const br_x509_trust_anchor* myTAs, int myNumTAs);
virtual ~BearSSLClient();


inline void setClient(Client& client) { _client = &client; }


virtual int connect(IPAddress ip, uint16_t port);
virtual int connect(const char* host, uint16_t port);
virtual size_t write(uint8_t);
Expand Down