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 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" );
28+ if (insecure) {
29+ addParameter (" -k" );
30+ }
2331 addParameter (url);
2432 return run ();
2533}
2634
2735unsigned int HttpClient::get (const char *url) {
2836 begin (" curl" );
37+ if (insecure) {
38+ addParameter (" -k" );
39+ }
2940 addParameter (url);
3041 return run ();
3142}
3243
3344void HttpClient::getAsynchronously (String &url) {
3445 begin (" curl" );
46+ if (insecure) {
47+ addParameter (" -k" );
48+ }
3549 addParameter (url);
3650 runAsynchronously ();
3751}
3852
3953void HttpClient::getAsynchronously (const char *url) {
4054 begin (" curl" );
55+ if (insecure) {
56+ addParameter (" -k" );
57+ }
4158 addParameter (url);
4259 runAsynchronously ();
4360}
@@ -50,4 +67,11 @@ unsigned int HttpClient::getResult() {
5067 return exitValue ();
5168}
5269
70+ void HttpClient::noCheckSSL () {
71+ insecure = true ;
72+ }
73+
74+ void HttpClient::checkSSL () {
75+ insecure = false ;
76+ }
5377
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