8000 WiFiSSLSE050Client: fix sni setting · arduino/ArduinoCore-mbed@148b74c · GitHub
[go: up one dir, main page]

Skip to content
Sign in

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 148b74c

Browse files
committed
WiFiSSLSE050Client: fix sni setting
1 parent 11c3c83 commit 148b74c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

libraries/SE05X/src/WiFiSSLSE050Client.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ class MbedSSLSE050Client : public arduino::MbedSSLClient {
4848
return 0;
4949
}
5050

51+
if(_hostname && !_disableSNI) {
52+
((TLSSocket*)sock)->set_hostname(_hostname);
53+
}
54+
5155
if( NSAPI_ERROR_OK != ((TLSSocket*)sock)->append_root_ca_cert(_ca_cert_custom)) {
5256
return 0;
5357
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include "MbedSSLClient.h"
22

3-
arduino::MbedSSLClient::MbedSSLClient(): _disableSNI{false} {
3+
arduino::MbedSSLClient::MbedSSLClient()
4+
: _ca_cert_custom(nullptr),
5+
_hostname(nullptr),
6+
_disableSNI(false) {
7+
48
onBeforeConnect(mbed::callback(this, &MbedSSLClient::setRootCA));
59
};

libraries/SocketWrapper/src/MbedSSLClient.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ class MbedSSLClient : public arduino::MbedClient {
5353
}
5454

5555
protected:
56-
const char* _ca_cert_custom = NULL;
57-
const char* _hostname = NULL;
56+
const char* _ca_cert_custom;
57+
const char* _hostname;
58+
bool _disableSNI;
5859

5960
private:
6061
int setRootCA() {
@@ -90,8 +91,6 @@ class MbedSSLClient : public arduino::MbedClient {
9091
}
9192
return err;
9293
}
93-
94-
bool _disableSNI;
9594
};
9695

9796
}

0 commit comments

Comments
 (0)
0