本地启动 注释配置https ssl证书 部署时放开即可。
This commit is contained in:
+8
-7
@@ -18,15 +18,11 @@ import org.springframework.context.annotation.Configuration;
|
||||
*/
|
||||
@Configuration
|
||||
public class TomcatFactoryConfig {
|
||||
@Value("${server.port-https}")
|
||||
private String serverPortHttp;
|
||||
@Value("${server.port}")
|
||||
private String serverPortHttps;
|
||||
|
||||
/**
|
||||
* tomcat-embed-jasper引用后提示jar找不到的问题
|
||||
*/
|
||||
/*@Bean
|
||||
@Bean
|
||||
public TomcatServletWebServerFactory tomcatFactory() {
|
||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() {
|
||||
@Override
|
||||
@@ -39,8 +35,13 @@ public class TomcatFactoryConfig {
|
||||
connector.setProperty("relaxedQueryChars", "[]{}");
|
||||
});
|
||||
return factory;
|
||||
}*/
|
||||
}
|
||||
|
||||
//TODO 配置https证书 部署服务器的时候解开。
|
||||
/* @Value("${server.port-https}")
|
||||
private String serverPortHttp;
|
||||
@Value("${server.port}")
|
||||
private String serverPortHttps;
|
||||
@Bean
|
||||
public TomcatServletWebServerFactory tomcatFactory() {
|
||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() {
|
||||
@@ -71,5 +72,5 @@ public class TomcatFactoryConfig {
|
||||
connector.setSecure(false);
|
||||
connector.setRedirectPort(Integer.parseInt(serverPortHttps));
|
||||
return connector;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
server:
|
||||
port: 8080
|
||||
port-https: 8089 #自定义https端口
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
error:
|
||||
@@ -13,10 +12,12 @@ server:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
|
||||
ssl: #配置https证书
|
||||
key-store: classpath:bxxt.hzwlsoft.com.jks
|
||||
key-store-password: w933m5y1kz0xj8w
|
||||
key-store-type: JKS
|
||||
##配置https证书 部署服务器的时候解开。
|
||||
# port-https: 8089 #自定义https端口
|
||||
# ssl:
|
||||
# key-store: classpath:bxxt.hzwlsoft.com.jks
|
||||
# key-store-password: w933m5y1kz0xj8w
|
||||
# key-store-type: JKS
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
|
||||
Reference in New Issue
Block a user