标签:sha webpack sources 工具 port eem password img http
keytool -genkey -alias tomcat -keyalg RSA -keystore server.keystore
application.yml
server:
port: 8324
http:
port: 8325
ssl:
key-store: ./src/main/resources/server.keystore
key-alias: tomcat
enabled: true
key-store-password: P@ssw0rd
key-store-type: JKS
server.http.port
指http的端口server.port
指的是https的端口key-store
指证书路径key-store-password
指第一步中输入的秘钥库口令https://127.0.0.1:8324/xxx
验证,如下:TomcatConfig
配置文件,读取配置文件中http
的端口配置http
访问import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class TomcatConfig {
@Value("${server.http.port}")
private int httpPort;
@Bean
public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer() {
return new EmbeddedServletContainerCustomizer() {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
if (container instanceof TomcatEmbeddedServletContainerFactory) {
TomcatEmbeddedServletContainerFactory containerFactory =
(TomcatEmbeddedServletContainerFactory) container;
Connector connector = new Connector(TomcatEmbeddedServletContainerFactory.DEFAULT_PROTOCOL);
connector.setPort(httpPort);
containerFactory.addAdditionalTomcatConnectors(connector);
}
}
};
}
}
http
bulid/webpack.dev.conf.js
文件下配置derServer.https
为true
https://localhost:端口
,如下:标签:sha webpack sources 工具 port eem password img http
原文地址:https://www.cnblogs.com/maggieq8324/p/12608980.html