【问题标题】:How to call https from SpringBoot如何从 Spring Boot 调用 https
【发布时间】:2020-02-19 11:05:54
【问题描述】:

从我的 Spring Boot 应用程序中,我想调用 Red Hat Decision Manager kie server rest API:

String serverUrl = "https://server:host/services/rest/server";
String username = "username";
String password = "password";

但我收到此错误:

java.lang.RuntimeException: org.kie.server.common.rest.NoEndpointFoundException: 找不到可用的端点

这是因为认证错误。我从该站点下载了认证并创建了密钥库。但是,如何从我们的 Spring Boot 中调用 https?

【问题讨论】:

  • 您当然可以发布执行实际休息调用的代码,并且您可以提供有关“创建密钥库”的更多详细信息。在哪里创建的?你是如何配置它的?还是您不知道如何配置信任库的问题?
  • 该错误似乎不是证书错误,您可以尝试使用 curl 命令访问您的 serverUrl 吗
  • @Gimby,我关注 link 以连接到决策管理器。
  • @ShaileshChandra,我可以访问上面的serverUrl,只是我无法通过代码连接到它。我正在关注这个link。这里他们提到了HTTP,但是在我们的环境中,一切都是https

标签: spring-boot redhat kie-server


【解决方案1】:

您可以使用rest模板从您的应用程序中调用rest API:

https://howtodoinjava.com/spring-boot2/resttemplate/spring-restful-client-resttemplate-example/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-13
    • 1970-01-01
    • 2017-03-16
    • 2022-10-07
    • 2019-05-17
    • 1970-01-01
    • 2014-05-02
    • 2021-05-28
    相关资源
    最近更新 更多