wwh 1 год назад
Родитель
Сommit
5bb423e925

+ 28 - 28
huimv-receive/src/main/java/com/huimv/receive/ReceiveApplication.java

@@ -18,32 +18,32 @@ public class ReceiveApplication {
         SpringApplication.run(ReceiveApplication.class, args);
     }
 
-//    @Bean
-//    public TomcatServletWebServerFactory servletContainer() {
-//        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
-//            @Override
-//            protected void postProcessContext(Context context) {
-//                SecurityConstraint constraint = new SecurityConstraint();
-//                constraint.setUserConstraint("CONFIDENTIAL");
-//                SecurityCollection collection = new SecurityCollection();
-//                collection.addPattern("/*");
-//                constraint.addCollection(collection);
-//                context.addConstraint(constraint);
-//            }
-//        };
-//        tomcat.addAdditionalTomcatConnectors(httpConnector());
-//        return tomcat;
-//    }
-//
-//    @Bean
-//    public Connector httpConnector() {
-//        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
-//        connector.setScheme("http");
-//        //Connector监听的http的默认端口号
-//        connector.setPort(8014);
-//        connector.setSecure(false);
-//        //监听到http的端口号后转向到的https的端口号,也就是项目配置的port
-//        connector.setRedirectPort(8015);
-//        return connector;
-//    }
+    @Bean
+    public TomcatServletWebServerFactory servletContainer() {
+        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
+            @Override
+            protected void postProcessContext(Context context) {
+                SecurityConstraint constraint = new SecurityConstraint();
+                constraint.setUserConstraint("CONFIDENTIAL");
+                SecurityCollection collection = new SecurityCollection();
+                collection.addPattern("/*");
+                constraint.addCollection(collection);
+                context.addConstraint(constraint);
+            }
+        };
+        tomcat.addAdditionalTomcatConnectors(httpConnector());
+        return tomcat;
+    }
+
+    @Bean
+    public Connector httpConnector() {
+        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
+        connector.setScheme("http");
+        //Connector监听的http的默认端口号
+        connector.setPort(8016);
+        connector.setSecure(false);
+        //监听到http的端口号后转向到的https的端口号,也就是项目配置的port
+        connector.setRedirectPort(8017);
+        return connector;
+    }
 }

+ 1 - 1
huimv-receive/src/main/java/com/huimv/receive/config/ApiPrefixAutoConfiguration.java

@@ -10,7 +10,7 @@ public class ApiPrefixAutoConfiguration implements WebMvcConfigurer {
 
     @Override
     public void configurePathMatch(PathMatchConfigurer configurer) {
-        configurer.addPathPrefix("/secureApi",  c -> c.isAnnotationPresent(RestController.class));
+        configurer.addPathPrefix("/securesApi",  c -> c.isAnnotationPresent(RestController.class));
     }
 
 }

BIN
huimv-receive/src/main/resources/12743383_receive.ifarmcloud.com.jks


+ 5 - 5
huimv-receive/src/main/resources/application-prod.yml

@@ -1,9 +1,9 @@
 server:
-  port: 8015
-#  ssl:
-#    key-store: classpath:10767421_huatong.ifarmcloud.com.jks
-#    key-store-type: jks
-#    key-store-password: sjp124g3
+  port: 8017
+  ssl:
+    key-store: classpath:12743383_receive.ifarmcloud.com.jks
+    key-store-type: jks
+    key-store-password: kh4wsh73
 
 spring:
   application: