当前位置: 首页 > 知识库问答 >
问题:

springboot - SpringBoot 没有成功加载SSL证书,怎么解决?

终翔
2023-08-02

控制台报这样的错

Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:/cert/gu.cloud.pfx'
class path resource [/cert/gu.cloud.pfx] cannot be resolved to URL because it does not exist

.yml文件我是这样配置

server:  port: 8443  ssl:    key-store: classpath:/cert/gu.cloud.pfx    key-password: 我的密码    key-store-type: pfx

证书名中.cloud是我的域名后缀
pom文件有添加这个插件的依赖

<plugin>    <groupId>org.apache.maven.plugins</groupId>    <artifactId>maven-resources-plugin</artifactId>    <version>3.1.0</version></plugin>

/cert/.pfx 和 cert/.pfx都试过了,还是找不到

<resource>    <directory>src/main/resources</directory>    <filtering>true</filtering>    <excludes>        <exclude>cert/*.pfx</exclude>    </excludes></resource><resource>    <directory>src/main/resources</directory>    <filtering>false</filtering>    <includes>        <include>cert/*.pfx</include>    </includes></resource>

共有1个答案

公冶子琪
2023-08-02

应该是 key-store-password 吧?

 类似资料:
  • 进入阿里云服务器,搜索ssl证书,免费申请,1.证书申请(自行选购) 2.下载证书 3.解压下载压缩包 4.将.pfx文件放至springboot项目resources目录下    applicatio.yml中添加配置   5.设置http自动重定向https(8082端口->443端口): 在SpringApplication启动类中加入以下代码:(注意网上有些代码中的EmbeddedServletContainerFactory找不到

  • 1.换任意空闲端口都会出现此问题 2.将SSL配置注释后,运行正常 错误原因: 在Spring 2.1.9.RELEASE中,Tomcat 9.0.26似乎是一个问题 。 降低Tomcat版本 Springboot修改内置Tomcat版本 此问题真的是让我几乎崩溃啊,疯掉的感觉。

  • 我有一个小的springboot应用程序。我需要使用HTPPS,我从CA购买带有嵌入式tomcat的SSL证书。我试着配置它。应用财产: p、 12.使用keytool创建 **.我从加州得到的crt。我也有私钥,但不知道我需要在哪里使用它。 当我尝试启动此应用程序时,出现了一个错误 为什么应用程序看不到别名?我在keystore中看到了。 可能我需要一些其他设置来在springboot tomc

  • AMH的SSL证书怎么弄啊?AMH怎么填写SSL证书啊? AMH的SSL证书怎么弄啊?AMH怎么填写SSL证书啊?

  • 本文向大家介绍为SpringBoot服务添加HTTPS证书的方法,包括了为SpringBoot服务添加HTTPS证书的方法的使用技巧和注意事项,需要的朋友参考一下 HTTPS是HTTP的安全版本,旨在提供数据传输层安全性(TLS)。当你的应用不使用HTTP协议的时候,浏览器地址栏就会出现一个不安全的提示。HTTPS加密每个数据包以安全方式进行传输,并保护敏感数据免受窃听者或黑客的攻击。 您可以通过

  • 我正在创建一个Java程序来从服务器获取信息,但我必须从Java程序与服务器执行ssl握手。 我有文件证书用于身份验证,但我不知道如何用java加载该证书,以便java程序可以与我想要从中获取信息的服务器进行“握手”。从哪里开始?