pub unsafe extern "C" fn esp_tls_conn_new_sync(
    hostname: *const i8,
    hostlen: i32,
    port: i32,
    cfg: *const esp_tls_cfg,
    tls: *mut esp_tls
) -> i32
Expand description

@brief Create a new blocking TLS/SSL connection

This function establishes a TLS/SSL connection with the specified host in blocking manner.

@param[in] hostname Hostname of the host. @param[in] hostlen Length of hostname. @param[in] port Port number of the host. @param[in] cfg TLS configuration as esp_tls_cfg_t. If you wish to open non-TLS connection, keep this NULL. For TLS connection, a pass pointer to esp_tls_cfg_t. At a minimum, this structure should be zero-initialized. @param[in] tls Pointer to esp-tls as esp-tls handle.

@return - -1 If connection establishment fails. - 1 If connection establishment is successful. - 0 If connection state is in progress.