【问题标题】:Migrate Java web application from http to Https将 Java Web 应用程序从 http 迁移到 Https
【发布时间】:2021-04-05 09:48:37
【问题描述】:

我必须将 Java Web 应用程序从 HTTP“迁移”到 HTTPS。在本地,我使用 Tomcat 进行开发,但在测试和生产环境 - WebSphere。

我在其他一些问题中看到了相同的答案,我们只需要在web.xml 中设置以下参数化:

<security-constraint>
    <web-resource-collection>
        <web-resource-name>AuthServer</web-resource-name>
        <url-pattern>/Server</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

如果我只使用此代码,应用程序将使用哪个证书?

除了web.xml中的上述代码之外,我还需要在服务器上设置一些认证吗?

【问题讨论】:

    标签: java servlets https ssl-certificate


    【解决方案1】:

    编辑您的 web.xml 并添加 &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt; 它只是为您的 Web 应用程序启用/添加安全约束。如果您想在您的服务器上使用 HTTPS,那么您必须先配置您的服务器。

    【讨论】:

      猜你喜欢
      • 2014-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-28
      相关资源
      最近更新 更多