Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP-TLS: esp_tls_conn_new_sync cannot open non-TLS connection (IDFGH-13865) #14711

Open
3 tasks done
aenima1891 opened this issue Oct 11, 2024 · 0 comments
Open
3 tasks done
Labels
Status: Opened Issue is new

Comments

@aenima1891
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I'm using ESP-IDF v5.3.1
In esp_tsl.h there is the esp_tls_conn_new_sync function

`/**

  • @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.
    */
    int esp_tls_conn_new_sync(const char *hostname, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_t *tls);
    `

if I pass a cfg=NULL param, the function return -1.
In fact, the function implementation is

int esp_tls_conn_new_sync(const char *hostname, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_t *tls)
{
if (!cfg || !tls || !hostname || hostlen < 0) {
return -1;
}
uint64_t start_time_us;
start_time_us = esp_tls_get_platform_time();
...

There is a mismatch between the header doc and the func implementation.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 11, 2024
@github-actions github-actions bot changed the title ESP-TLS: esp_tls_conn_new_sync cannot open non-TLS connection ESP-TLS: esp_tls_conn_new_sync cannot open non-TLS connection (IDFGH-13865) Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

2 participants