Spring Boot integrated configuration HTTPS

This is the mason of 108 original articles Engineering: * JDK 1.8 * Maven 3.5.2 * Spring Boot 1.5.9.RELEASE ## a, HTTPS is what Q: What is HTTP A:? HTTP is a client and server side standard TCP protocol requests and responses. For example, open my blog address: `` `java https://www.bysocket.com` `` more than a S, S actually represents TLS, SSL. So HTTP infrastructure as shown:! [File] (https://www.bysocket.com/wp-content/uploads/2015/05/1_thumb.png) HTTP protocol (HyperText Transfer Protocol), Hypertext transfer protocol server to the client browser transport protocols used. The Web, the server and the client using the HTTP protocol for communication sessions. It integrates the HTTPS, simply modify Tomcat container configuration, add a layer to the configuration corresponding to security constraints. ## Second, the application HTTPS #### 2.1 applications open SSL certificate Ali cloud certificate, you can apply for free for one year. Continue year after year to apply for free. Download, select Tomcat piece, because the integration only need to modify the Spring Boot embedded Tomcat container configuration. If nginx, can also be downloaded and integrated configuration corresponding to 2.2 #### certificate file the certificate introduced in the console version download Tomcat certificate is downloaded to a local compressed file, which contains the unpacked file is a .pfx certificate file, pfx_password. txt file is password credentials. ! [File] (http://www.bysocket.com/wp-content/uploads/2019/06/3.png) the other two configuration modes: - PFX certificate installed - JKS used herein, the certificate install PFX certificate installed. ## Third, configure HTTPS copy the .pfx file to the root directory of resources, and then configure the application-prod. addCollection (collection); context.addConstraint (constraint);}}; return tomcat;}} `` `to run, has been seen from the log support HTTPS:` `` java 2019-06-16 10: 42: 42.989 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat initialized with port (s): 443 (https) 2019-06-16 10: 42: 45.782 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat started on port (s): 443 (https) `` `Precautions: - this is the configuration 1.x, 2.x versions differ - https default port number is 443. The machine can be changed environment will occupy port 8080 and so on - if a machine two HTTPS service, it can be operated by ### references setRedirectPort * Spring Boot 2.x series: https: //www.bysocket.com/ springboot * spring.io official document ### following topics tutorials Maybe you will be interested in - "Art of War program: algorithms and data structures" https://www.bysocket.com/technique/2314.html - "Spring Boot 2.x tutorial series "https://www.bysocket.com/springboot -" Java core tutorial series "https://www.bysocket.com/technique/2100.html return tomcat;}} `` `to run, has been seen from the log support HTTPS:` `` java 2019-06-16 10: 42: 42.989 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat initialized with port (s ): 443 (https) 2019-06-16 10: 42: 45.782 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat started on port (s): 443 (https) `` `Precautions: - this is 1.x configuration, 2.x versions differ - https default port number is 443. The machine can be changed environment will occupy port 8080 and so on - if a machine two HTTPS service, it can be operated by ### references setRedirectPort * Spring Boot 2.x series: https: //www.bysocket.com/ springboot * spring.io official document ### following topics tutorials Maybe you will be interested in - "Art of War program: algorithms and data structures" https://www.bysocket.com/technique/2314.html - "Spring Boot 2.x tutorial series "https://www.bysocket.com/springboot -" Java core tutorial series "https://www.bysocket.com/technique/2100.html return tomcat;}} `` `to run, has been seen from the log support HTTPS:` `` java 2019-06-16 10: 42: 42.989 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat initialized with port (s ): 443 (https) 2019-06-16 10: 42: 45.782 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat started on port (s): 443 (https) `` `Precautions: - this is 1.x configuration, 2.x versions differ - https default port number is 443. The machine can be changed environment will occupy port 8080 and so on - if a machine two HTTPS service, it can be operated by ### references setRedirectPort * Spring Boot 2.x series: https: //www.bysocket.com/ springboot * spring.io official document ### following topics tutorials Maybe you will be interested in - "Art of War program: algorithms and data structures" https://www.bysocket.com/technique/2314.html - "Spring Boot 2.x tutorial series "https://www.bysocket.com/springboot -" Java core tutorial series "https://www.bysocket.com/technique/2100.html Tomcat initialized with port (s): 443 (https) 2019-06-16 10: 42: 45.782 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat started on port (s): 443 (https) `` `Precautions: - this is the configuration 1.x, 2.x versions differ - https default port number is 443. The machine can be changed environment will occupy port 8080 and so on - if a machine two HTTPS service, it can be operated by ### references setRedirectPort * Spring Boot 2.x series: https: //www.bysocket.com/ springboot * spring.io official document ### following topics tutorials Maybe you will be interested in - "Art of War program: algorithms and data structures" https://www.bysocket.com/technique/2314.html - "Spring Boot 2.x tutorial series "https://www.bysocket.com/springboot -" Java core tutorial series "https://www.bysocket.com/technique/2100.html Tomcat initialized with port (s): 443 (https) 2019-06-16 10: 42: 45.782 INFO 16727 --- [main] sbcetTomcatEmbeddedServletContainer: Tomcat started on port (s): 443 (https) `` `Precautions: - this is the configuration 1.x, 2.x versions differ - https default port number is 443. The machine can be changed environment will occupy port 8080 and so on - if a machine two HTTPS service, it can be operated by ### references setRedirectPort * Spring Boot 2.x series: https: //www.bysocket.com/ springboot * spring.io official document ### following topics tutorials Maybe you will be interested in - "Art of War program: algorithms and data structures" https://www.bysocket.com/technique/2314.html - "Spring Boot 2.x tutorial series "https://www.bysocket.com/springboot -" Java core tutorial series "https://www.bysocket.com/technique/2100.html x version is different - https default port number is 443. The machine can be changed environment will occupy port 8080 and so on - if a machine two HTTPS service, it can be operated by ### references setRedirectPort * Spring Boot 2.x series: https: //www.bysocket.com/ springboot * spring.io official document ### following topics tutorials Maybe you will be interested in - "Art of War program: algorithms and data structures" https://www.bysocket.com/technique/2314.html - "Spring Boot 2.x tutorial series "https://www.bysocket.com/springboot -" Java core tutorial series "https://www.bysocket.com/technique/2100.html x version is different - https default port number is 443. The machine can be changed environment will occupy port 8080 and so on - if a machine two HTTPS service, it can be operated by ### references setRedirectPort * Spring Boot 2.x series: https: //www.bysocket.com/ springboot * spring.io official document ### following topics tutorials Maybe you will be interested in - "Art of War program: algorithms and data structures" https://www.bysocket.com/technique/2314.html - "Spring Boot 2.x tutorial series "https://www.bysocket.com/springboot -" Java core tutorial series "https://www.bysocket.com/technique/2100.html

Guess you like

Origin www.cnblogs.com/Alandre/p/11114706.html
Recommended