Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How springboot2-tomcat-https accesses and configures ssl

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

In this issue, the editor will bring you about how springboot2-tomcat-https accesses and configures ssl. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

(1) application.properties configuration

# https port number.

Server.port: 8888

# the path to the certificate.

Server.ssl.key-store: classpath:key.keystore

# Certificate password, please change it to your own certificate password.

Server.ssl.key-store-password: XXXXXX

# KeyStore type

Server.ssl.keyStoreType: JKS

(2) you can use jdk to make your own certificate key.keystore

There are two ways to obtain a security certificate: one is to apply for a CA certificate from an authority, and the other is to create a self-signed certificate.

Cmd to the jdk installation directory bin to execute

Keytool-genkey-alias tomcat-keypass 123654-keyalg RSA-keysize 1024-validity 36500-keystore D:\ key.keystore-storepass 123654-dname "CN=127.0.0.1, OU=shsj, Odysshsj"

Explanation:

Keytool-genkey-alias (alias)-keypass (alias password)-keyalg RSA (algorithm)-keysize 1024 (key length)-validity 1024 (validity period) Unit: days)-keystore D:\ storage address\ keystore.keystore (private key file)-storepass 123654 (private key password)-dname "CN= (first and last name), OU= (organizational unit name), O = (organization name), L = (city or region name), ST= (state or province name), C = (two-letter country code of the unit)"

Be sure to pay attention to the configuration of the first name and last name here. CN,CN really means the configuration of the address you visit. If your project only wants to access the ip of the server through the ip address, if there is a formal domain name, fill in the domain name here, such as: www.baidu.com, I did not write it here, it is used for testing by myself. Modify the hosts file of windows and add a line 127.0.0.1, and you can access it by simulating the domain name locally.

If the package is war, it is tomcat access to configure tomcat,https access, where to access the keystoreFile file, and what is the password keystorePass

This is how to access and configure ssl for springboot2-tomcat-https shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report