User Manual
Note: A set of common root certificates are already included in the WICED Feather SDK, so most HTTPS websites will
work out of the box, but if you need to add a new root certificate chain the TLS/certificate data is set using the
following function in the Adafruit Feather class (accessible as `Feather.addRootCA(...)`):
bool addRootCA(uint8_t const* root_certs_der, uint16_t len);
int connectSSL (const char* host, uint16_t port)
Attempts to connect to a secure server using SSL/TLS at the specified domain name and port.
Parameters:
host: A string containing the domain name to connect to
port: The port number to connect to (0..65536)
Returns: 'true' (1) if the connection was successfully established, otherwise 'false' (0).
Note: A set of common root certificates are already included in the WICED Feather SDK, so most HTTPS websites will
work out of the box, but if you need to add a new root certificate chain the TLS/certificate data is set using the
following function in the Adafruit Feather class (accessible as `Feather.addRootCA(...)`):
bool addRootCA(uint8_t const* root_certs_der, uint16_t len);
uint8_t connected (void)
Indicates whether we are currently connected to the TCP server or not
Parameters: None
Returns: 'true' (1) if we are currently connected to the TCP server, otherwise 'false' (0).
void stop (void)
Closes the current connection to the TCP server (if a connection is open).
Parameters: None
Returns: Nothing
Stream API
AdafruitTCP implements the Stream (https://adafru.it/lGe) class, with the following method overrides present in
AdafruitTCP:
int read (void)
Reads the first available byte from the data buffer (if any data is available).
If certificate verification fails when trying to connect to a secure server you will get
ERROR_TLS_UNTRUSTED_CERTIFICATE (5035).
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 77 of 202










