Fix HTTP Client with SSL (#3216)

This commit is contained in:
Me No Dev
2019-09-16 19:14:32 +03:00
committed by GitHub
parent 07390157df
commit 4ce2cc3c1d
3 changed files with 17 additions and 4 deletions

View File

@ -22,7 +22,7 @@
const char *pers = "esp32-tls";
static int handle_error(int err)
static int _handle_error(int err, const char * file, int line)
{
if(err == -30848){
return err;
@ -30,12 +30,15 @@ static int handle_error(int err)
#ifdef MBEDTLS_ERROR_C
char error_buf[100];
mbedtls_strerror(err, error_buf, 100);
log_e("%s", error_buf);
log_e("[%s():%d]: (%d) %s", file, line, err, error_buf);
#else
log_e("[%s():%d]: code %d", file, line, err);
#endif
log_e("MbedTLS message code: %d", err);
return err;
}
#define handle_error(e) _handle_error(e, __FUNCTION__, __LINE__)
void ssl_init(sslclient_context *ssl_client)
{