File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 18
18
19
19
#include " HttpClient.h"
20
20
21
+ HttpClient::HttpClient () :
22
+ insecure(false ) {
23
+ // Empty
24
+ }
25
+
21
26
unsigned int HttpClient::get (String &url) {
22
27
begin (" curl" );
28
+ if (insecure) {
29
+ addParameter (" -k" );
30
+ }
23
31
addParameter (url);
24
32
return run ();
25
33
}
26
34
27
35
unsigned int HttpClient::get (const char *url) {
28
36
begin (" curl" );
37
+ if (insecure) {
38
+ addParameter (" -k" );
39
+ }
29
40
addParameter (url);
30
41
return run ();
31
42
}
32
43
33
44
void HttpClient::getAsynchronously (String &url) {
34
45
begin (" curl" );
46
+ if (insecure) {
47
+ addParameter (" -k" );
48
+ }
35
49
addParameter (url);
36
50
runAsynchronously ();
37
51
}
38
52
39
53
void HttpClient::getAsynchronously (const char *url) {
40
54
begin (" curl" );
55
+ if (insecure) {
56
+ addParameter (" -k" );
57
+ }
41
58
addParameter (url);
42
59
runAsynchronously ();
43
60
}
@@ -50,4 +67,11 @@ unsigned int HttpClient::getResult() {
50
67
return exitValue ();
51
68
}
52
69
70
+ void HttpClient::noCheckSSL () {
71
+ insecure = true ;
72
+ }
73
+
74
+ void HttpClient::checkSSL () {
75
+ insecure = false ;
76
+ }
53
77
Original file line number Diff line number Diff line change 23
23
24
24
class HttpClient : public Process {
25
25
public:
26
+ HttpClient ();
26
27
27
28
unsigned int get (String &url);
28
29
unsigned int get (const char * url);
29
30
void getAsynchronously (String &url);
30
31
void getAsynchronously (const char * url);
31
32
boolean ready ();
32
33
unsigned int getResult ();
34
+ void noCheckSSL ();
35
+ void checkSSL ();
36
+
37
+ private:
38
+ boolean insecure;
33
39
34
40
};
35
41
You can’t perform that action at this time.
0 commit comments