Skip to content

Commit 564edbc

Browse files
authored
Merge pull request #57 from arduino/fix_basic_auth
ussl: Fix basic authentication mode on Linux.
2 parents 02aec9e + d96a8a4 commit 564edbc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/arduino_iot_cloud/ussl.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,20 @@ def init(pin, certfile, keyfile, engine_path, module_path):
3232

3333
def wrap_socket(
3434
sock_in,
35-
pin,
36-
certfile,
37-
keyfile,
35+
pin=None,
36+
certfile=None,
37+
keyfile=None,
3838
ca_certs=None,
3939
cert_reqs=CERT_NONE,
4040
ciphers=None,
4141
engine_path=_ENGINE_PATH,
4242
module_path=_MODULE_PATH,
4343
):
44+
if certfile is None or keyfile is None:
45+
# Fallback to Python's SSL
46+
import ssl
47+
return ssl.wrap_socket(sock_in)
48+
4449
if _key is None or _cert is None:
4550
init(pin, certfile, keyfile, engine_path, module_path)
4651

0 commit comments

Comments
 (0)