no matching function for call to 'BearSSL::WiFiClientSecure::connect()

For some reason I get "no matching function for call to 'BearSSL::WiFiClientSecure::connect()'". I got this from an example of HTTPS connection, if this doesn't work, what will?

void httpsRequest(String sHost, String sURL) {
  Serial.print("connecting to ");
  Serial.println(sHost);

  Serial.printf("Using fingerprint '%s'\n", fingerprint);
  clients.setFingerprint(fingerprint);

  if (!clients.connect(sHost, 443)) {
    Serial.println("connection failed");
    return;
  }

  String url = sURL;
  Serial.print("requesting URL: ");
  Serial.println(url);
String postCmd = "POST " + url + " HTTP/1.1";

  if (clients.connect()) {
    Serial.println("connected");
    clients.println(postCmd);
    clients.println("Host: none");
    clients.println("User-Agent: Arduino/1.0");
    clients.println("Connection: close");
    clients.println("Content-Type: application/json;");
    clients.print("Content-Length: ");
    clients.println(PostData.length());
    clients.println();
    clients.println(PostData);
  } else {
    Serial.println("connection failed");
  }

  Serial.println("request sent");
  while (clients.connected()) {
    String line = clients.readStringUntil('\n');
    if (line == "\r") {
      Serial.println("headers received");
      break;
    }
  }
  String line = clients.readStringUntil('\n');
  if (line.startsWith("{\"state\":\"success\"")) {
    Serial.println("esp8266/Arduino CI successfull!");
  } else {
    Serial.println("esp8266/Arduino CI has failed");
  }
  Serial.println("reply was:");
  Serial.println("==========");
  Serial.println(line);
  Serial.println("==========");
  Serial.println("closing connection");
}

The statement that the compiler is complaining about does not appear in the code you posted. And, you did not include the full error message which would probably indicate where it does appear. Not sure how much help is available given such a poor problem description.

It does. Line 364 where it says “if (!clients.connect) {” …that is flagged with the error carrot. Here is all the errors and warnings.

What I want from the sketch is it to interpret UDP codes from other nodes, send back commands, send reports to PC via Serial and SMS via IFTTT. It also will switch profile and activate alarms on BlueIris security software. It is the central unit. IFTTT insists on HTTPS.

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino: In function 'void getProfile()':

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino:268:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     sendUDP("9107"); //Testing, turn on strobes

                   ^

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino: In function 'void httpsRequest(String, String)':

node9-10:364:23: error: no matching function for call to 'BearSSL::WiFiClientSecure::connect()'

   if (clients.connect()) {

                       ^

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino:364:23: note: candidates are:

In file included from C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecure.h:41:0,

                 from C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiServerSecure.h:20,

                 from C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:41,

                 from C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino:11:

C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:40:9: note: virtual int BearSSL::WiFiClientSecure::connect(const IPAddress&, uint16_t)

     int connect(CONST IPAddress& ip, uint16_t port) override;

         ^

C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:40:9: note:   candidate expects 2 arguments, 0 provided

C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:41:9: note: virtual int BearSSL::WiFiClientSecure::connect(const String&, uint16_t)

     int connect(const String& host, uint16_t port) override;

         ^

C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:41:9: note:   candidate expects 2 arguments, 0 provided

C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:42:9: note: virtual int BearSSL::WiFiClientSecure::connect(const char*, uint16_t)

     int connect(const char* name, uint16_t port) override;

         ^

C:\Users\matt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:42:9: note:   candidate expects 2 arguments, 0 provided

node9-10:372:21: error: 'PostData' was not declared in this scope

     clients.println(PostData.length());

                     ^

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino: In function 'void parsePacket2(char*)':

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino:419:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     sendUDP("9103");

                   ^

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino:470:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

           sendUDP("9103");

                         ^

C:\Users\matt\Documents\Arduino\node9-10\node9-10.ino:561:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         sendUDP("9107");

                       ^

Attached find the entire code,

node9-public.ino (15.3 KB)

Did you perhaps mean line 363 to be:

  if (clients.connected()) {

?

It says that there is no connect() function which takes 0 argument, which you wrongly call here:

if (clients.connect())

At a glance, there is no need to check for sequentially client connection since you never reach to that point if the connection is failed. If you disagree, please provide the link to the source code.

I fixxed it. It should read if (clients.connectED). But I got another problem for another thread.