diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index eb1b63f..9e38954 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,9 +15,9 @@ jobs: - name: Fetch submodules run: | - git submodule update --init --depth=1 - ( cd vendor/micropython/ports/unix ; make submodules ) - ( cd vendor/micropython/ports/esp32 ; make submodules ) + git submodule update --init --recursive #--depth=1 + # ( cd vendor/micropython/ports/unix ; make submodules ) + # ( cd vendor/micropython/ports/esp32 ; make submodules ) - name: Test run: | @@ -26,7 +26,7 @@ jobs: - name: Build run: | rm -rf ./vendor/micropython/mpy-cross/build # Workaround build failure - docker run -t -u "$UID:$GID" -e "HOME=/app" -v "${GITHUB_WORKSPACE}:/app" -w "/app" espressif/idf:v5.1.2 make + docker run -t -u "$UID:$GID" -e "HOME=/app" -v "${GITHUB_WORKSPACE}:/app" -w "/app" espressif/idf:v5.4 make shell: bash - name: Upload to Golioth (Main) diff --git a/.gitmodules b/.gitmodules index c54ae01..772f21e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "vendor/micropython"] path = vendor/micropython - url = https://github.com/Ribbit-Network/micropython - branch = pr/mbedtls + url = https://github.com/micropython/micropython ignore = dirty [submodule "vendor/microdot"] path = vendor/microdot diff --git a/modules/ribbit/coap/__init__.py b/modules/ribbit/coap/__init__.py index e5a7733..254de9d 100644 --- a/modules/ribbit/coap/__init__.py +++ b/modules/ribbit/coap/__init__.py @@ -3,13 +3,12 @@ import socket import random import os -import ssl import asyncio import asyncio.core as _asyncio_core +import tls from micropython import const - _HEADER_SIZE = const(4) _OPTION_HEADER_SIZE = const(1) _PAYLOAD_MARKER = const(0xFF) @@ -446,8 +445,8 @@ async def connect(self): if self._ssl is not False: ctx = self._ssl if ctx is True: - ctx = ssl.SSLContext( - ssl.PROTOCOL_DTLS_CLIENT + ctx = tls.TLSContext( + tls.PROTOCOL_DTLS_CLIENT ) sock = ctx.wrap_socket( diff --git a/modules/ribbit/golioth/__init__.py b/modules/ribbit/golioth/__init__.py index 950a65e..3ecb566 100644 --- a/modules/ribbit/golioth/__init__.py +++ b/modules/ribbit/golioth/__init__.py @@ -3,6 +3,7 @@ import time from micropython import const import asyncio +import tls import ribbit.config as _config import ribbit.coap as _coap @@ -87,9 +88,8 @@ async def _loop(self): if enabled: self._logger.info("Starting Golioth integration") - import ssl - ctx = ssl.SSLContext( - ssl.PROTOCOL_DTLS_CLIENT + ctx = tls.SSLContext( + tls.PROTOCOL_DTLS_CLIENT ) ctx.set_ciphers(["TLS-PSK-WITH-AES-128-CBC-SHA256"]) ctx.set_psk(user, password) diff --git a/vendor/micropython b/vendor/micropython index 12f3c0f..f1018ee 160000 --- a/vendor/micropython +++ b/vendor/micropython @@ -1 +1 @@ -Subproject commit 12f3c0f51f1d84b83c7d78bcfdba60ede036d792 +Subproject commit f1018ee5c2dd0eabcc0cfe7e02c607594e489788