@@ -49,16 +49,20 @@ class HttpsRequest : public HttpRequestBase {
4949 const char * ssl_ca_pem,
5050 http_method method,
5151 const char * url,
52- Callback<void (const char *at, uint32_t length)> body_callback = 0 )
52+ mbed:: Callback<void (const char *at, uint32_t length)> body_callback = 0 )
5353 : HttpRequestBase(NULL , body_callback)
5454 {
55+ _error = 0 ;
56+ _network = network;
57+
5558 _parsed_url = new ParsedUrl (url);
5659 _request_builder = new HttpRequestBuilder (method, _parsed_url);
5760 _response = NULL ;
5861
5962 _socket = new TLSSocket ();
6063 ((TLSSocket*)_socket)->open (network);
61- ((TLSSocket*)_socket)->set_root_ca_cert (ssl_ca_pem);
64+ // ((TLSSocket*)_socket)->set_root_ca_cert(ssl_ca_pem);
65+ ((TLSSocket*)_socket)->set_root_ca_cert (" /wlan/" , 0 );
6266 _we_created_socket = true ;
6367 }
6468
@@ -76,7 +80,7 @@ class HttpsRequest : public HttpRequestBase {
7680 HttpsRequest (TLSSocket* socket,
7781 http_method method,
7882 const char * url,
79- Callback<void (const char *at, uint32_t length)> body_callback = 0 )
83+ mbed:: Callback<void (const char *at, uint32_t length)> body_callback = 0 )
8084 : HttpRequestBase(socket, body_callback)
8185 {
8286 _parsed_url = new ParsedUrl (url);
@@ -91,7 +95,10 @@ class HttpsRequest : public HttpRequestBase {
9195
9296protected:
9397 virtual nsapi_error_t connect_socket (char *host, uint16_t port) {
94- return ((TLSSocket*)_socket)->connect (host, port);
98+ SocketAddress socketAddress = SocketAddress ();
99+ socketAddress.set_port (port);
100+ _network->gethostbyname (host, &socketAddress);
101+ return ((TLSSocket*)_socket)->connect (socketAddress);
95102 }
96103};
97104
0 commit comments