keytool -genkey -alias httpsserver -keyalg RSA -keysize 2048 -keystore server.p12 -validity 3650
- @Configuration
- public class TomcatConfig {
-
- @Value("${server.http.port}")
- private int httpPort;
-
- @Bean
- public ServletWebServerFactory servletContainer() {
- TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
- tomcat.addAdditionalTomcatConnectors(createStandardConnector()); // 添加http
- return tomcat;
- }
-
- private Connector createStandardConnector() {
- Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
- connector.setPort(httpPort);
- return connector;
- }
- }
- # 服务启动端口
- server:
- port: 40024
- http:
- port: 40023
- # https config
- ssl:
- enabled: true
- key-store: classpath:server.p12
- key-store-password: password.
pdfbox jar包下载(版本号换成自己想要的即可)
https://dlcdn.apache.org/pdfbox/2.0.28/pdfbox-2.0.28.jar
mvn install:install-file -Dfile=下载的jar包位置 -DgroupId=org.apache.pdfbox -DartifactId=pdfbox -Dversion=2.0.28 -Dpackaging=jar
如:
mvn install:install-file -Dfile=pdfbox-2.0.28.jar -DgroupId=org.apache.pdfbox -DartifactId=pdfbox -Dversion=2.0.28 -Dpackaging=jar