我试图强制执行蔚蓝的Java Web应用程序运行在Tomcat 1.7 HTTPS。 (使用门户创建的应用程序wa) 我已将下面的web.config添加到站点/ wwwroot目录。这通过https正确地重定向非http调用,但在应用程序内部,请求似乎具有http而不是https。Azure的Web应用程序不通过HTTPS方案,以Java Web应用程序
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*"
verb="*" modules="httpPlatformHandler"
resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%AZURE_TOMCAT7_HOME%\bin\startup.bat">
</httpPlatform>
<rewrite>
<rules>
<rule name="Force HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我认为这可能是为应用程序来显示HTTP而不是HTTPS的标准行为,但我肯定期待下面来呈现真实
HttpServletRequest request
request.isSecure() //this should be true
request.getScheme() //Ideally should be https but is http
请问有什么需要添加到我的web.config文件?
不知道,如果它使太大的区别,但我使用CA签名的通配符证书,我还通过门户网站上传。这是明确的工作,因为我无法在我的Web应用程序上进行HTTPS调用,并且在证书上传之后,我能够进行调用。
在此先感谢您的帮助。
当您向您的网站发出https请求时会发生什么?请求在您的应用程序中是否仍然显示为http? –
没有就算我打它直接是HTTP应用中,仍然显示的是假当我打电话的isSecure() – Asrar
是否正确HTTPS负荷,如果你运行你的本地计算机上的网站? –