Streamlit-webrtc error - "Unsupported key type" error in from_cryptography_key in python3.9/site-packages/OpenSSL/ file

testing the webrtc component locally with the basic code:

from streamlit_webrtc import webrtc_streamer

it worked last week, but it stopped working today with the following error:

TypeError: Unsupported key type


File ".../lib/python3.9/site-packages/streamlit/runtime/scriptrunner/", line 565, in _run_script exec(code, module.__dict__)
File ".../streamlit-webrtc-main/pages/", line 37, in <module>
    webrtc_streamer(key="example", video_frame_callback=videoFilter)
File ".../lib/python3.9/site-packages/streamlit_webrtc/", line 568, in webrtc_streamer
    webrtc_worker = WebRtcWorker(
File ".../lib/python3.9/site-packages/streamlit_webrtc/", line 375, in __init__
    self.pc = RTCPeerConnection()
File ".../lib/python3.9/site-packages/aiortc/", line 294, in __init__
    self.__certificates = [RTCCertificate.generateCertificate()]
File ".../lib/python3.9/site-packages/aiortc/", line 156, in generateCertificate
File "..../lib/python3.9/site-packages/OpenSSL/", line 274, in from_cryptography_key
    raise TypeError("Unsupported key type")

I have updated streamlit to version 1.19.0 and streamlit-webrtc to version 0.44.7. but i’m still facing the same issue. Please guide me on what to do in order to resolve this issue. Thank you.

Manage to get webrtc running in streamlit again. Not sure if this is the solution, @whitphx - but this works for now.

I found that my issue was related to an outdated version of pyOpenSSL -

current version was 23.0.0 and the version in my conda was 22.0.0 - so i had to update it - using pip didn’t work for me, so i used conda

conda install -c conda-forge pyopenssl

1 Like