crossbario / autobahn-python

WebSocket and WAMP in Python for Twisted and asyncio
https://crossbar.io/autobahn
MIT License
2.47k stars 763 forks source link

Twisted + websockets + TLS (wss) gives "invalid certificate" in Safari (and only there) #1594

Open msedv opened 1 year ago

msedv commented 1 year ago

autobahn-python-master/examples/twisted/websocket/echo_tls: I added the Letsencrypt cer&key of the Apache on the server the code is running on; works great in all browsers apart from Safari (no matter if on my macOS with 12.5.1 or on an iPad Air). No chance to find out why.

autobahn-python-master/examples/twisted/websocket/echo_site_tls: a little bit more information from Safari:

cer_autobahn

For reference the same Safari requesting via https from the Apache running with the same certificate on the same machine without any problems:

cer_apache

Next experiment: autobahn with asyncio. No sample in github thus I expanded the echo-sample with using a SSL-context to switch to wss:

SSLcontext = ssl.SSLContext (ssl.PROTOCOL_TLS_SERVER)
SSLcontext.load_cert_chain ("xxx.cer", "xxx.key")
....

which again works great everywhere including Safari.

The only combination I can not get running is Twisted+Websockets+TLS on Safari. And this is the combination we have written our app with - and I think it isn't a good idea to say "runs everywhere if it's not from Apple". :-) For testing we can go back to http/ws - but that's also not a real "solution".

Anyone any idea?