该网站无法提供显示如何解决此错误的安全连接?

时间:2020-05-20 11:15:01

标签: spring-boot http authentication ssl https

我的应用程序基于spring boot和微服务架构。有FrontUI,CartService,AuthService微服务。

FrontUI具有

@GetMapping("/search")
public String getSearch(...){
// code
}
@GetMapping("/login")
    public String getLogin() {
        return "login";
}

当我键入http://localhost:8080/search并按Enter键时,一切正常,将显示包含产品的搜索页面。但是当我点击“登录”按钮时,URL更改为https://localhost:8080/login,然后

此网站无法提供安全的连接 本地主机发送了无效的响应。 ERR_SSL_PROTOCOL_ERROR

显示

错误。 我试图从Chrome删除所有数据 我尝试查询HSTS / PKP域,但未找到任何内容

我认为我应该使用ssl配置项目。或不? 谢谢

1 个答案:

答案 0 :(得分:0)

实际上,应用程序正在重定向到https://localhost:8080/login,因为链接<a>就像<a href="https://localhost:8080/login">一样,除了重定向到https://localhost:8080/login之外没有其他机会。由于未为Spring项目配置HTTPS,因此显示错误。查看此链接以了解如何配置https://www.thomasvitale.com/https-spring-boot-ssl-certificate/ 希望如此有用