IDEA控制台取消悬浮
idea 全局配置
SpringBoot(Tomcat) 配置https,同时支持http
利用JDK生成证书
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.`
`
http请求
https请求
将jar包安装到maven仓库
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`
`