How to create https webserver using sslsocket

I want to create a webserver that can support many diffrent domains like nginx. For http request , that’s easy to read the request host from http header , but it’s very hard for me to do that under https.
Here this the document of ssl [ssl — TLS/SSL wrapper for socket objects — Python 3.11.1 documentation]. It says that when you want to create socket object under ssl, you must use load_cert_chain to load server ssl certificate. But this function can only load just one certificate … so If i have many different domains with different certificate, how can i do it ?

英语不是很好,这儿再用中文翻译一下。
我想基于 socket 来构建一个类似 nginx 的 web 服务器。对于 没有加密的http 普通请求,我能够很容易的从请求头中读出请求的host ,但是我很难在https 下面做到。
l [ssl — TLS/SSL wrapper for socket objects — Python 3.11.1 documentation]. 指出,当你想要新建一个 ssl socket 对象时,你必须使用 load_cert_chain 这个函数来加载服务器上的证书。但是这个函数 一次只能加载一张证书,如果我有不同的域名(证书也不同),那我需要怎么做呢

I think you need to support TLS SNI.