@@ -49,16 +49,20 @@ class HttpsRequest : public HttpRequestBase {
49
49
const char * ssl_ca_pem,
50
50
http_method method,
51
51
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 )
53
53
: HttpRequestBase(NULL , body_callback)
54
54
{
55
+ _error = 0 ;
56
+ _network = network;
57
+
55
58
_parsed_url = new ParsedUrl (url);
56
59
_request_builder = new HttpRequestBuilder (method, _parsed_url);
57
60
_response = NULL ;
58
61
59
62
_socket = new TLSSocket ();
60
63
((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 );
62
66
_we_created_socket = true ;
63
67
}
64
68
@@ -76,7 +80,7 @@ class HttpsRequest : public HttpRequestBase {
76
80
HttpsRequest (TLSSocket* socket,
77
81
http_method method,
78
82
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 )
80
84
: HttpRequestBase(socket, body_callback)
81
85
{
82
86
_parsed_url = new ParsedUrl (url);
@@ -91,7 +95,10 @@ class HttpsRequest : public HttpRequestBase {
91
95
92
96
protected:
93
97
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);
95
102
}
96
103
};
97
104
0 commit comments