File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Expand file tree Collapse file tree 2 files changed +30
-4
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" );
23
- addParameter (" -k" );
28
+ if (insecure) {
29
+ addParameter (" -k" );
30
+ }
24
31
addParameter (url);
25
32
return run ();
26
33
}
27
34
28
35
unsigned int HttpClient::get (const char *url) {
29
36
begin (" curl" );
30
- addParameter (" -k" );
37
+ if (insecure) {
38
+ addParameter (" -k" );
39
+ }
31
40
addParameter (url);
32
41
return run ();
33
42
}
34
43
35
44
void HttpClient::getAsynchronously (String &url) {
36
45
begin (" curl" );
37
- addParameter (" -k" );
46
+ if (insecure) {
47
+ addParameter (" -k" );
48
+ }
38
49
addParameter (url);
39
50
runAsynchronously ();
40
51
}
41
52
42
53
void HttpClient::getAsynchronously (const char *url) {
43
54
begin (" curl" );
44
- addParameter (" -k" );
55
+ if (insecure) {
56
+ addParameter (" -k" );
57
+ }
45
58
addParameter (url);
46
59
runAsynchronously ();
47
60
}
@@ -54,4 +67,11 @@ unsigned int HttpClient::getResult() {
54
67
return exitValue ();
55
68
}
56
69
70
+ void HttpClient::noCheckSSL () {
71
+ insecure = true ;
72
+ }
73
+
74
+ void HttpClient::checkSSL () {
75
+ insecure = false ;
76
+ }
57
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