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 1818
1919#include " HttpClient.h"
2020
21+ HttpClient::HttpClient () :
22+ insecure(false ) {
23+ // Empty
24+ }
25+
2126unsigned int HttpClient::get (String &url) {
2227 begin (" curl" );
23- addParameter (" -k" );
28+ if (insecure) {
29+ addParameter (" -k" );
30+ }
2431 addParameter (url);
2532 return run ();
2633}
2734
2835unsigned int HttpClient::get (const char *url) {
2936 begin (" curl" );
30- addParameter (" -k" );
37+ if (insecure) {
38+ addParameter (" -k" );
39+ }
3140 addParameter (url);
3241 return run ();
3342}
3443
3544void HttpClient::getAsynchronously (String &url) {
3645 begin (" curl" );
37- addParameter (" -k" );
46+ if (insecure) {
47+ addParameter (" -k" );
48+ }
3849 addParameter (url);
3950 runAsynchronously ();
4051}
4152
4253void HttpClient::getAsynchronously (const char *url) {
4354 begin (" curl" );
44- addParameter (" -k" );
55+ if (insecure) {
56+ addParameter (" -k" );
57+ }
4558 addParameter (url);
4659 runAsynchronously ();
4760}
@@ -54,4 +67,11 @@ unsigned int HttpClient::getResult() {
5467 return exitValue ();
5568}
5669
70+ void HttpClient::noCheckSSL () {
71+ insecure = true ;
72+ }
73+
74+ void HttpClient::checkSSL () {
75+ insecure = false ;
76+ }
5777
Original file line number Diff line number Diff line change 2323
2424class HttpClient : public Process {
2525 public:
26+ HttpClient ();
2627
2728 unsigned int get (String &url);
2829 unsigned int get (const char * url);
2930 void getAsynchronously (String &url);
3031 void getAsynchronously (const char * url);
3132 boolean ready ();
3233 unsigned int getResult ();
34+ void noCheckSSL ();
35+ void checkSSL ();
36+
37+ private:
38+ boolean insecure;
3339
3440};
3541
You can’t perform that action at this time.
0 commit comments