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-idf-config/sdkconfig.defaults: Fix TLS access to api.github.com; remove BLE from 4MB ESP32-S3 #8924

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Feb 15, 2024

Both of the options below were not set (and therefore not turned on), and it caused TLS access to api.github.com to not work at all.

# CONFIG_MBEDTLS_ECP_NIST_OPTIM is not set
# CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM is not set

Turning on either one fixes the problem. Turning on CONFIG_MBEDTLS_ECP_NIST_OPTIM instead of CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM is smaller (+2.2kB vs +6.9kB) and faster (1.6 seconds vs 7.6 seconds, at least some of the time).

I don't understand why some "OPTIM" must be turned on for it to work at all, but I'll accept that at face value. I experimented with various combinations.

tag @justmobilize

EDIT: This didn't fit on a few boards, so I went ahead and did the refactoring and BLE trimming we talked about:

  • Turn off _bleio by default on ESP32-S3 4MB boards.
  • Turn off _bleio by default in mpconfigport.mk for C3 and C6, and then removed that setting from a bunch of mpconfigboard.mk files.
  • Turn on gifio and jpegio on any boards with displayio enabled (consulted with @jepler about this). Previous those modules were dependent on espcamera, which may just have been copy pasta or something like that.

@dhalbert dhalbert requested a review from tannewt February 15, 2024 02:16
@dhalbert dhalbert changed the title esp-idf-config/sdkconfig.defaults: Fix TLS access to api.github.com esp-idf-config/sdkconfig.defaults: Fix TLS access to api.github.com; remove BLE from 4MB ESP32-S3 Feb 15, 2024
@dhalbert dhalbert requested a review from jepler February 15, 2024 03:28
@justmobilize
Copy link

I tested this with:

  • Adafruit MagTag with ESP32S2 - passed
  • FeatherS3 with ESP32S3 - passed
  • Adafruit Feather ESP32-S3 TFT with ESP32S3 - passed

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

so the theory is, github gets tired of waiting for key exchange without the optimized implementation of the algorithm?

@dhalbert
Copy link
Collaborator Author

so the theory is, github gets tired of waiting for key exchange without the optimized implementation of the algorithm?

That could be. I looked at the code and I don't see that's it non-functional without the optimizations.

I think we want the optimizations anyway because it's quite slow without them in 9.0.0 compared with 8.2.x, enough to provoke #8919.

@dhalbert dhalbert merged commit 8291467 into adafruit:main Feb 15, 2024
178 checks passed
@dhalbert dhalbert deleted the tls-nist-optim branch February 15, 2024 18:01
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.

Slower https access on 9.0.0 Unable to connect to api.github.com
3 participants