此内容没有您所选择的语言版本。
15.4. EJB3 RMI via HTTPS Configuration
Procedure 15.5. Configure EJB3 RMI via HTTPS Overview
- Generate encryption keys and certificates.
- Configure RMI via HTTPS web connector.
- Configure Servlets.
- Configure secure remoting connector for RMI via HTTPS.
- Configure EJB3 beans for HTTPS transport.
- Configure clients for RMI via HTTPS.
Procedure 15.6. Configure RMI via HTTPS web connector
- Edit the file
jboss-as/server/$PROFILE/deploy/jbossweb.sar/server.xml
and uncomment the HTTPS connector.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You create a web connector to accept SSL connections.
Procedure 15.7. Configure Servlets
ServletServerInvoker
.
- Create a directory named
servlet-invoker.war
injboss-as/server/$PROFILE/deploy/
. - Create a
WEB-INF
directory in theservlet-invoker.war
directory. - Create a file named
web.xml
in thatWEB-INF
directory, with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Result:You create a servlet to forward SSL requests from the web container to a server invoker.
locatorUrl
is used to connect the servlet to the remoting connector through the " InvokerLocator
attribute of the remoting connector we define in Procedure 15.8, “Configure secure remoting connector for RMI via HTTPS” .
Procedure 15.8. Configure secure remoting connector for RMI via HTTPS
- Create a file named
servlet-invoker-service.xml
injboss-as/server/$PROFILE/deploy/
, with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You create a remoting connector that can receive requests from a servlet, and invoke methods of an EJB3.
Procedure 15.9. Configure EJB3 beans for HTTPS transport
- Annotate the bean for RMI via HTTPS:
Example 15.5. Annotating an EJB3 for RMI via HTTPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Result:The EJB3 is now available for remote invocation via HTTPS.
Optionally, you can annotate the bean for invocation via RMI via HTTP. This can be useful for testing, as it allows you to tunnel RMI calls through firewalls that block RMI ports, but removes the extra layer of the security configuration.
Example 15.6. Annotating a bean for RMI via HTTP
The EJB client should use the following properties for the JNDI lookup when looking up beans:
Client access to RMI via HTTP(S)
- HTTPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - HTTP
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
jboss-as/$PROFILE/deploy/http-invoker.sar/invoker.war/WEB-INF/jboss-web.xml
.