This repository was archived by the owner on Jun 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -58,26 +58,26 @@ int main(void)
58
58
return result;
59
59
}
60
60
61
- TLSSocket *socket = new TLSSocket;
62
- result = socket->set_root_ca_cert (cert);
61
+ printf (" Connecting to ifconfig.io\n " );
62
+ SocketAddress addr;
63
+ result = net->gethostbyname (" ifconfig.io" , &addr);
63
64
if (result != NSAPI_ERROR_OK) {
64
- printf (" Error: socket->set_root_ca_cert() returned %d\n " , result);
65
- return result;
65
+ printf (" Error! DNS resolution for ifconfig.io failed with %d\n " , result);
66
66
}
67
+ addr.set_port (443 );
67
68
69
+ TLSSocket *socket = new TLSSocket;
68
70
result = socket->open (net);
69
71
if (result != NSAPI_ERROR_OK) {
70
72
printf (" Error! socket->open() returned: %d\n " , result);
71
73
return result;
72
74
}
73
75
74
- printf (" Connecting to ifconfig.io\n " );
75
- SocketAddress addr;
76
- result = net->gethostbyname (" ifconfig.io" , &addr);
76
+ result = socket->set_root_ca_cert (cert);
77
77
if (result != NSAPI_ERROR_OK) {
78
- printf (" Error! DNS resolution for ifconfig.io failed with %d\n " , result);
78
+ printf (" Error: socket->set_root_ca_cert() returned %d\n " , result);
79
+ return result;
79
80
}
80
- addr.set_port (443 );
81
81
82
82
result = socket->connect (addr);
83
83
if (result != NSAPI_ERROR_OK) {
You can’t perform that action at this time.
0 commit comments