首先前端,vue打包后生成了dist,使用tomcat作为静态服务器,在tomcat中使用jks格式配置https(不是jks可以不用往下看了):
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/cdc.com.jks" certificateKeystorePassword="602tsfe" type="RSA"/>
SSLHostConfig>
Connector>
<login-config>
<auth-method>CLIENT-CERTauth-method>
<realm-name>Client Cert Users-only Arearealm-name>
login-config>
<security-constraint>
<web-resource-collection >
<web-resource-name >SSLweb-resource-name>
<url-pattern>/*url-pattern>
web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIALtransport-guarantee>
user-data-constraint>
security-constraint>
# 配置https:
server.ssl.key-store=classpath:cd.com.jks
server.ssl.key-store-password=60fe
server.ssl.key-store-type=JKS