#req 总配置 [ req ] default_bits = 2048 distinguished_name = req_distinguished_name #使用 req_distinguished_name配置模块 req_extensions = req_ext #使用 req_ext配置模块 [ req_distinguished_name ] countryName = Country Name (2 letter code) countryName_default = CN stateOrProvinceName = State or Province Name (full name) stateOrProvinceName_default = ShanXi localityName = Locality Name (eg, city) localityName_default = TaiYuan organizationName = Organization Name (eg, company) organizationName_default = DuYong commonName = Common Name (e.g. server FQDN or YOUR name) commonName_max = 64 commonName_default = localhost #这里的Common Name 写主要域名即可(注意:这个域名也要在alt_names的DNS.x里) 此处尤为重要,需要用该服务名字填写到客户端的代码中 [ req_ext ] subjectAltName = @alt_names #使用 alt_names配置模块 [alt_names] DNS.1 = localhost DNS.2 = tyduyong.com DNS.3 = www.tyduyong.com IP = 127.0.0.1