Skip to content

add WiFiClientSecure library #164

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

Closed
wants to merge 0 commits into from
Closed

add WiFiClientSecure library #164

wants to merge 0 commits into from

Conversation

copercini
Copy link
Contributor

-new WiFiClientSecure lib for ESP32
-fixed mbedTLS config file path in platform.txt
-put full bignum.h file insted of include_next (with bug)

int connect(IPAddress ip, uint16_t port, unsigned char* rootCABuff, unsigned char* cli_cert, unsigned char* cli_key);
int connect(const char *host, uint16_t port, unsigned char* rootCABuff, unsigned char* cli_cert, unsigned char* cli_key);

int startClient(sslclient_context *ssl_client, uint32_t ipAddress, uint32_t port, unsigned char* rootCABuff, unsigned char* cli_cert, unsigned char* cli_key);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all those methods should be private/protected right? The user does not have access to the sslclient_context anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, any more bugs?

@copercini
Copy link
Contributor Author

It's not working for MQTT too.

The connection is ok, but after connect the read function is called and the server don't send anything causing a timeout. (I tested with shiftr.io and AWS iot and both have the same problem)

I still don't realize where is the bug...

@me-no-dev
Copy link
Member

I found out why the header was "missing" from tools/sdk ;) will fix in next commit of idf libs

@me-no-dev
Copy link
Member

please see here for formatting your code :)

@copercini
Copy link
Contributor Author

copercini commented Feb 5, 2017

ok, first I am trying to fix the problem with MQTT over TLS. I think the bug is in available() function which doesn't return the correct number of bytes to read, causing timeouts and lost connection.

I tried with ioctl(ssl_client->socket, FIONREAD, &count); and mbedtls_ssl_get_bytes_avail(&ssl_client->ssl_ctx)); but it always return 0, even when there is.

@me-no-dev
Copy link
Member

can you please switch to my branch and see if you can compile without changing platform.txt and the header
git pull && git checkout me-no-dev

@copercini
Copy link
Contributor Author

It compiles fine without changing platform.txt and the header!

Based on this response of Angus http://esp32.com/viewtopic.php?f=13&t=1101 , the problem with MQTT seems fixed too.

@me-no-dev
Copy link
Member

I was looking at the idf examples yesterday and I noticed that OpenSSL client and server are also added. I think maybe we need to figure out better naming conversion and have both options available. I'll try to do some digging tonight and see if I come up with something.
You can sync this PR in a mean time to not include platform.txt and the bignim header

@copercini copercini closed this Feb 8, 2017
brentru pushed a commit to adafruit/arduino-esp32 that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants