Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 不安全的HttpServletRequest getURI谷歌云_Spring Boot_Servlets_Google Cloud Platform_Google Cloud Run - Fatal编程技术网

Spring boot 不安全的HttpServletRequest getURI谷歌云

Spring boot 不安全的HttpServletRequest getURI谷歌云,spring-boot,servlets,google-cloud-platform,google-cloud-run,Spring Boot,Servlets,Google Cloud Platform,Google Cloud Run,我们正在使用Auth0集成为我们的spring引导应用程序提供身份验证。 在google cloud run中使用docker部署了一个应用程序 但当我尝试交换令牌时,我收到来自auth0的一个错误https://.. 但请转到http://。” 发生这种情况的原因是httpServletReuqest.getRequestURI()返回http而不是https 问题是,当我们的网站在云中部署为https时,为什么getRequestURI返回http? 我还记录了nginx标题和X-Forwa

我们正在使用Auth0集成为我们的spring引导应用程序提供身份验证。 在google cloud run中使用docker部署了一个应用程序

但当我尝试交换令牌时,我收到来自auth0的一个错误https://.. 但请转到http://。” 发生这种情况的原因是
httpServletReuqest.getRequestURI()
返回http而不是https

问题是,当我们的网站在云中部署为https时,为什么getRequestURI返回http?
我还记录了nginx标题和X-Forwarded-Proto=https。

作为社区Wiki发布,因为它基于@EmilGi和@GuillaumeBlaquiere的评论

如您所见:

Cloud Run将所有HTTP请求重定向到HTTPS,但在它们到达web服务之前终止TLS。如果您的服务生成的web资源引用了具有不安全URL(http://)的其他web资源,则您的页面可能会出现混合内容警告或错误


您无法关闭此限制,因为Cloud Run部署在负责TLS通信的GFE(谷歌前端)后面。

我认为这是由于在请求到达您的应用程序之前使用负载均衡器造成的。但是有没有办法使其不终止TLS?还没有。CloudRun部署在负责TLS通信的GFE(谷歌前端)后面。