【问题标题】:how to generate a self signed and configure an SSL?如何生成自签名并配置 SSL?
【发布时间】:2009-07-11 21:30:53
【问题描述】:

我对 SSL 很陌生,想在 GLASSFISH 上为我的应用程序安装 SSL,虽然试图找到一些可以从基础教我的教程,但找不到任何详细的解决方案。 1)喜欢如何为 SSL 生成自签名证书? 2)如何使用我的应用程序配置此证书? 3)如何在 SSL 上只配置登录页面? 4)这个openSSL是什么,如何在应用中使用?

【问题讨论】:

    标签: java security ssl openssl ssl-certificate


    【解决方案1】:

    【讨论】:

    • 我想在 SSL 上配置唯一的登录页面,一旦认证完成,我就不需要这个 SSL
    • 所以你想要 http 用于登录,而 http 用于其他一切?
    • 12 年后大多数链接都失效了...在您的回复中复制有用的信息真是太好了
    • 肯定有比重新访问 12 年前的链接更好的方法来提高您的声誉。
    【解决方案2】:

    对于问题3。可以这样做:

    1. 在以下位置创建一个名为“userauth”的安全领域指令: http://docs.oracle.com/cd/E18930_01/html/821-2435/ggkuk.html

    2. 配置您的 web.xml 以通过要求设置 CONFIDENTIAL(加密)属性来保护您的登录页面。示例:

      <security-constraint>   
          <display-name>ConstraintSSL</display-name>
          <web-resource-collection>
              <web-resource-name>protected</web-resource-name>
              <description/>
              <url-pattern>/login/*</url-pattern>
              <url-pattern>/login.*</url-pattern>
              <http-method>GET</http-method>
              <http-method>POST</http-method>
              <http-method>HEAD</http-method>
              <http-method>PUT</http-method>
              <http-method>OPTIONS</http-method>
              <http-method>TRACE</http-method>
              <http-method>DELETE</http-method>
          </web-resource-collection>
      
          <user-data-constraint>        
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
          </user-data-constraint>        
      </security-constraint>
      
      
      <security-role>
          <description/>
          <role-name>USERS</role-name>
      </security-role>
      <security-role>
          <description/>
          <role-name>ADMINISTRATORS</role-name>
      </security-role>
      

    使用上述配置,登录页面(login.* 或 /login/*)需要安全通道,在本例中为 HTTPS。因此,如果您在 glassfish 服务器中正确配置,您的应用程序将自动重定向到 SSL 端口。

    【讨论】:

      猜你喜欢
      • 2014-04-05
      • 2016-12-04
      • 2016-09-26
      相关资源
      最近更新 更多