Skip to content

Commit

Permalink
Merge pull request #158 from justmobilize/fix-get-radio-ssl-context
Browse files Browse the repository at this point in the history
Fix get_radio_ssl_context
  • Loading branch information
dhalbert authored Mar 1, 2024
2 parents 52bd7c8 + 6d2bef3 commit 5b9304d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/esp32spi/requests_esp32spi_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os

import adafruit_connection_manager
import adafruit_esp32spi.adafruit_esp32spi_socket as pool
import board
import busio
from adafruit_esp32spi import adafruit_esp32spi
Expand Down Expand Up @@ -44,7 +43,8 @@
print("Connected to", str(radio.ssid, "utf-8"), "\tRSSI:", radio.rssi)

# Initialize a requests session
ssl_context = adafruit_connection_manager.create_fake_ssl_context(pool, radio)
pool = adafruit_connection_manager.get_radio_socketpool(radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(radio)
requests = adafruit_requests.Session(pool, ssl_context)

JSON_GET_URL = "https://httpbin.org/get"
Expand Down
4 changes: 2 additions & 2 deletions examples/esp32spi/requests_esp32spi_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os

import adafruit_connection_manager
import adafruit_esp32spi.adafruit_esp32spi_socket as pool
import board
import busio
from adafruit_esp32spi import adafruit_esp32spi
Expand Down Expand Up @@ -44,7 +43,8 @@
print("Connected to", str(radio.ssid, "utf-8"), "\tRSSI:", radio.rssi)

# Initialize a requests session
ssl_context = adafruit_connection_manager.create_fake_ssl_context(pool, radio)
pool = adafruit_connection_manager.get_radio_socketpool(radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(radio)
requests = adafruit_requests.Session(pool, ssl_context)

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
Expand Down
4 changes: 2 additions & 2 deletions examples/wiznet5k/requests_wiznet5k_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# SPDX-License-Identifier: MIT

import adafruit_connection_manager
import adafruit_wiznet5k.adafruit_wiznet5k_socket as pool
import board
import busio
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
Expand All @@ -17,7 +16,8 @@
radio = WIZNET5K(spi_bus, cs)

# Initialize a requests session
ssl_context = adafruit_connection_manager.create_fake_ssl_context(pool, radio)
pool = adafruit_connection_manager.get_radio_socketpool(radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(radio)
requests = adafruit_requests.Session(pool, ssl_context)

JSON_GET_URL = "http://httpbin.org/get"
Expand Down
4 changes: 2 additions & 2 deletions examples/wiznet5k/requests_wiznet5k_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# SPDX-License-Identifier: MIT

import adafruit_connection_manager
import adafruit_wiznet5k.adafruit_wiznet5k_socket as pool
import board
import busio
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
Expand All @@ -17,7 +16,8 @@
radio = WIZNET5K(spi_bus, cs)

# Initialize a requests session
ssl_context = adafruit_connection_manager.create_fake_ssl_context(pool, radio)
pool = adafruit_connection_manager.get_radio_socketpool(radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(radio)
requests = adafruit_requests.Session(pool, ssl_context)

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
Expand Down

0 comments on commit 5b9304d

Please sign in to comment.