Using the MKRWiFI1010 and a MKR ETH Shield, I try to establish an SSL-client to a static IP server.
I am using the default example of the SSLClient library, called EthernetHTTPS.
It works out of the box, until the moment where I try with a static IP:
The example says:
// if you don't want to use DNS (and reduce your sketch size) // use the numeric IP instead of the name for the server: IPAddress server(54,85,55,79); // numeric IP for Google (no DNS) // const char server = "www.arduino.cc"; // name address for Arduino (using DNS) const char server_host = "www.arduino.cc"; // leave this alone, change only above two
Therfore I use the numeric IP for Google (no DNS) option. But the example no longer works.
I get the following error message:
Initialize Ethernet: connecting to 126.96.36.199... (SSLClient)(SSL_WARN)(connect): Using a raw IP Address for an SSL connection bypasses some important verification steps. You should use a domain name (www.google.com) whenever possible. (SSLClient)(SSL_ERROR)(connect): Failed to connect using m_client. Are you connected to the internet? connection failed (SSLClient)(SSL_ERROR)(available): Cannot operate if the write error is not reset: (SSLClient)(SSL_ERROR)(m_print_ssl_error): SSL_CLIENT_CONNECT_FAIL (SSLClient)(SSL_ERROR)(connected): Not connected because write error is set (SSLClient)(SSL_ERROR)(m_print_ssl_error): SSL_CLIENT_CONNECT_FAIL disconnecting.
What is wrong here ?
Why is the default example not working ?
Does it have to do with the
trust_anchor.h file ? (by default it is set up for www.arduino.cc most likely).
Is there another option where I can achieve a HTTPS-WebClient over Ethernet connecting to a given static IP address using the MKRWiFi1010 ??