这是我的系统配置:Ubuntu 16.4,openssl-1.1.1,python 3.7.0。
下面的代码是我的服务器配置:
import ssl
from aiohttp import web
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
sslcontext.load_cert_chain("/home/bhuvneshwar/keysetup/northcredential/server_cert.pem", "/home/bhuvneshwar/keysetup/northcredential/server_key.pem")
sslcontext.load_verify_locations(cafile='/home/bhuvneshwar/keysetup/northcredential/server_root_ca.pem')
web.run_app(app, host='0.0.0.0', port=9001, ssl_context=ssl_context)
下面的命令是我的客户请求:
curl -v --cacert /home/bhuvneshwar/keysetup/clientcredential/server_root_ca.pem --cert /home/bhuvneshwar/keysetup/clientcredential/client_cert.pem --key /home/bhuvneshwar/keysetup/clientcredential/client_key.pem https://localhost:9001
请纠正我缺少SSL的位置和内容。