File tree 2 files changed +18
-3
lines changed
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 31
31
#include " BearSSLClient.h"
32
32
33
33
BearSSLClient::BearSSLClient (Client& client) :
34
- BearSSLClient(client, TAs, TAs_NUM)
34
+ BearSSLClient(client, TAs, TAs_NUM, false )
35
+ {
36
+ }
37
+
38
+ BearSSLClient::BearSSLClient (Client& client, bool noSNI) :
39
+ BearSSLClient(client, TAs, TAs_NUM, noSNI)
35
40
{
36
41
}
37
42
38
43
BearSSLClient::BearSSLClient (Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs) :
44
+ BearSSLClient(client, TAs, TAs_NUM, false )
45
+ {
46
+ }
47
+
48
+ BearSSLClient::BearSSLClient (Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs, bool noSNI) :
39
49
_client(&client),
40
50
_TAs(myTAs),
41
- _numTAs(myNumTAs)
51
+ _numTAs(myNumTAs),
52
+ _noSNI(noSNI)
42
53
{
43
54
_ecKey.curve = 0 ;
44
55
_ecKey.x = NULL ;
@@ -72,7 +83,7 @@ int BearSSLClient::connect(const char* host, uint16_t port)
72
83
return 0 ;
73
84
}
74
85
75
- return connectSSL (host);
86
+ return connectSSL (_noSNI ? NULL : host);
76
87
}
77
88
78
89
size_t BearSSLClient::write (uint8_t b)
Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ class BearSSLClient : public Client {
38
38
39
39
public:
40
40
BearSSLClient (Client& client);
41
+ BearSSLClient (Client& client, bool noSNI);
41
42
BearSSLClient (Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs);
43
+ BearSSLClient (Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs, bool noSNI);
42
44
virtual ~BearSSLClient ();
43
45
44
46
virtual int connect (IPAddress ip, uint16_t port);
@@ -72,6 +74,8 @@ class BearSSLClient : public Client {
72
74
const br_x509_trust_anchor* _TAs;
73
75
int _numTAs;
74
76
77
+ bool _noSNI;
78
+
75
79
br_ec_private_key _ecKey;
76
80
br_x509_certificate _ecCert;
77
81
bool _ecCertDynamic;
You can’t perform that action at this time.
0 commit comments