ssl - 如何使用 JBoss 6 在 RMIIO 流上启用加密

标签 ssl encryption jboss rmi rmiio

我想加密 JBoss 6.1.0.Final 服务器和我的客户端之间的通信。为此,我通过 RMI 激活了 SSL,它运行良好。但是,我也使用 RMIIO,当我通过 RMI 激活 SSL 加密时,它没有自动加密。在最佳情况下,我想使用与加密 RMI 通信相同的加密技术。

这是我的配置:

server/myThing/deploy/remoting-jboss-beans.xml

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">

    <deployment xmlns="urn:jboss:bean-deployer:2.0">

       <bean name="UnifiedInvokerConnector" class="org.jboss.remoting.transport.Connector">
          <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.remoting:service=Connector,transport=socket",exposedInterface=org.jboss.remoting.transport.ConnectorMBean.class,registerDirectly=true)</annotation>
          <property name="serverConfiguration"><inject bean="UnifiedInvokerConfiguration"/></property>
          <!-- add this to configure the SSL socket for the UnifiedInvoker -->
          <property name="serverSocketFactory"><inject bean="SSLServerSocketFactoryEJB2"/></property>
       </bean>

       <!-- Remoting server configuration -->
       <bean name="UnifiedInvokerConfiguration" class="org.jboss.remoting.ServerConfiguration">
          <constructor>
             <!-- Changed from socket to sslsocket -->
             <parameter>sslsocket</parameter>
          </constructor>
          <!-- some other stuff, kept as the default config -->
       </bean>

       <!-- Some stuff removed to simplify the explanation -->

       <!-- Added for SSL security -->
       <bean name="SSLServerSocketFactoryEJB2" class="org.jboss.security.ssl.DomainServerSocketFactory">
         <constructor>
           <parameter><inject bean="EJB2SSLDomain"/></parameter>
         </constructor>
       </bean>

       <!-- Added for SSL security -->
       <bean name="EJB2SSLDomain" class="org.jboss.security.plugins.JaasSecurityDomain">
         <constructor>
           <parameter>EJB2SSLDomain</parameter>
         </constructor>
         <property name="keyStoreURL">C:\MyData\Security\ssl.keystore</property>
         <property name="keyStorePass">MyPassword</property>
         <property name="keyStoreAlias">MyAlias</property>
         <property name="trustStorePass">MyPassword</property>
       </bean>

    </deployment>

server/myThing/deploy/properties-service.xml

<server>

  <!-- some stuff removed -->

  <mbean code="org.jboss.varia.property.SystemPropertiesService" 
     name="jboss:type=Service,name=SystemProperties">

    <attribute name="Properties">
      com.healthmarketscience.rmiio.exporter.port=11099
    </attribute>

  </mbean>
</server>

最佳答案

我已经有一段时间没研究 RMI 和 SSL 了。但是,RMIIO 有一个特定的接口(interface),允许您自定义底层的“远程处理”实现,RemoteStreamExporter .如果您查看 DefaultRemoteStreamExporter实现,您可以看到默认情况下如何导出 RMI 对象。我的猜测是您想使用调用 4 parameter export method 的类似实现使用适当的 RMI SSL 套接字工厂。

关于ssl - 如何使用 JBoss 6 在 RMIIO 流上启用加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35611631/

相关文章:

来自 Git 存储库的 R studio 项目,自签名证书问题

Delphi - 与 Indy 组件的 SSL TCP 通信

ruby - 加密空字符串

java - 如何在 Java EE 服务器中获取调度程序作业

web-applications - 如何处理 HTTP 状态 404 并将用户重定向到应用程序重新部署时的不同页面

java - 如何解决-控制台错误日志无法写入Log4j2配置文件

apache - 我发现一个问题,当我将 apache benchmark(ab) 与 http 一起使用时

c# - 如何在 linux 中为 .Net Core HttpListener 配置 ssl

python - 在 Python REST API 中实现 CSRF 保护

java - 如何在不使用 keytool 进行 AES 加密的情况下添加、删除或显示 keystore 中的 key ?