我想加密 JBoss 6.1.0.Final 服务器和我的客户端之间的通信。为此,我通过 RMI 激活了 SSL,它运行良好。但是,我也使用 RMIIO,当我通过 RMI 激活 SSL 加密时,它并没有自动加密。在最好的情况下,我想使用我用来加密 RMI 通信的相同加密技术。
这是我的配置:
服务器/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>
服务器/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>