I have to implement a Python based web server on a Linux based firmware for an embedded system component:
class WebServer(http.server.HTTPServer)
...
...
It's not recommended to do this TLS stuff in the webserver with Python. It's better to do it using nginx or apache. They support both the pkcs#11 SSL context and are fast to negociate SSL since they are written in C.
So to resume: