简体   繁体   English

Spring 引导容器在 Azure 应用服务中具有信任库

[英]Spring boot container With truststore in Azure App Service

I have a legacy spring boot Application that uses a common library that injects a RestTemplate which is default configured to make some HTTPS calls, Meaning it is always looking for a trust-store in the classpath.我有一个旧版 spring 引导应用程序,它使用一个通用库,该库注入一个 RestTemplate,默认配置为进行一些 HTTPS 调用,这意味着它总是在类路径中寻找信任库。 Spring boot by default needs a key store when we enable trust-store Spring 启动默认需要密钥库,当我们启用信任库时

Issue问题

I successfully containerized and deployed this app in the App service however App service is failing with the below error我成功地将这个应用程序容器化并部署在应用程序服务中,但是应用程序服务失败并出现以下错误

Bad Request This combination of host and port requires TLS.错误请求 主机和端口的这种组合需要 TLS。

Most of the comments out there suggest App service containers need to run on HTTP with port 80 and not HTTPS.大多数评论表明应用服务容器需要在 HTTP 上运行,端口为 80,而不是 HTTPS。

Questions问题

  1. Is there a way to deploy this container running HTTPS to be deployed on the App service and get a call at an endpoint?有没有办法部署这个运行 HTTPS 的容器以部署在 App 服务上并在端点上接听电话?
  2. How are people deploying spring boot apps in Azure app service if there is a requirement for trust-store as in trusting the third party servers?如果像信任第三方服务器一样需要信任存储,人们如何在 Azure 应用服务中部署 spring 引导应用?

Any help is appreciated任何帮助表示赞赏

If I am reading this correctly you are looking to do outbound SSL with a trust store.如果我没看错,您正在寻找使用信任存储的出站 SSL。 If you store your trust store certificate in Azure Key Vault you can use the Azure Key Vault Certificate Spring Boot starter to accomplish what you need.如果您将信任存储证书存储在 Azure Key Vault 中,您可以使用 Azure Key Vault Certificate Spring Boot starter 来完成您需要的操作。

See https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/azure-spring-boot-starter-keyvault-certificates/README.md#client-side-ssl请参阅https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/azure-spring-boot-starter-keyvault-certificates/README.md#client-side-ssl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM