File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 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 {
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 }
Original file line number Diff line number Diff line change 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};
Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ class MbedSSLClient : public arduino::MbedClient {
5353 }
5454
5555protected:
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
5960private:
6061 int setRootCA () {
@@ -90,8 +91,6 @@ class MbedSSLClient : public arduino::MbedClient {
9091 }
9192 return err;
9293 }
93-
94- bool _disableSNI;
9594};
9695
9796}
You can’t perform that action at this time.
0 commit comments