File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change 29
29
import errno
30
30
import sys
31
31
32
+ WIZNET5K_SSL_SUPPORT_VERSION = (9 , 1 )
33
+
32
34
# typing
33
35
34
36
@@ -132,21 +134,15 @@ def get_radio_socketpool(radio):
132
134
# versions of the Wiznet5k library or on boards withouut the ssl module
133
135
# see https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html
134
136
ssl_context = None
135
- try_ssl = False
136
137
cp_version = sys .implementation [1 ]
137
- if pool .SOCK_STREAM == 1 and cp_version [0 ] >= 9 :
138
- if cp_version [0 ] > 9 :
139
- try_ssl = True
140
- elif cp_version [0 ] == 9 and cp_version [1 ] >= 1 :
141
- try_ssl = True
142
-
143
- if try_ssl :
144
- try :
145
- import ssl # pylint: disable=import-outside-toplevel
146
-
147
- ssl_context = ssl .create_default_context ()
148
- except ImportError :
149
- """SSL not on board default to fake_ssl_context"""
138
+ if pool .SOCK_STREAM == 1 and cp_version >= WIZNET5K_SSL_SUPPORT_VERSION :
139
+ try :
140
+ import ssl # pylint: disable=import-outside-toplevel
141
+
142
+ ssl_context = ssl .create_default_context ()
143
+ pool .set_interface (radio )
144
+ except ImportError :
145
+ """SSL not on board default to fake_ssl_context"""
150
146
151
147
if ssl_context is None :
152
148
ssl_context = create_fake_ssl_context (pool , radio )
You can’t perform that action at this time.
0 commit comments