File tree 3 files changed +12
-5
lines changed
3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ class MbedSSLSE050Client : public arduino::MbedSSLClient {
48
48
return 0 ;
49
49
}
50
50
51
+ if (_hostname && !_disableSNI) {
52
+ ((TLSSocket*)sock)->set_hostname (_hostname);
53
+ }
54
+
51
55
if ( NSAPI_ERROR_OK != ((TLSSocket*)sock)->append_root_ca_cert (_ca_cert_custom)) {
52
56
return 0 ;
53
57
}
Original file line number Diff line number Diff line change 1
1
#include " MbedSSLClient.h"
2
2
3
- arduino::MbedSSLClient::MbedSSLClient (): _disableSNI{false } {
3
+ arduino::MbedSSLClient::MbedSSLClient ()
4
+ : _ca_cert_custom(nullptr ),
5
+ _hostname(nullptr ),
6
+ _disableSNI(false ) {
7
+
4
8
onBeforeConnect (mbed::callback (this , &MbedSSLClient::setRootCA));
5
9
};
Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ class MbedSSLClient : public arduino::MbedClient {
53
53
}
54
54
55
55
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;
58
59
59
60
private:
60
61
int setRootCA () {
@@ -90,8 +91,6 @@ class MbedSSLClient : public arduino::MbedClient {
90
91
}
91
92
return err;
92
93
}
93
-
94
- bool _disableSNI;
95
94
};
96
95
97
96
}
You can’t perform that action at this time.
0 commit comments