Hi,
You would need one of the latest subversion revisions to do this. Some
changes regarding this problem are very recent (yesterday).
You can do this by having a Context per Server and a distinct
SslContextFactory in each.
The documentation will improve, meanwhile you can check these two
messages [1][2].
Something like this should work:
Component component = new Component();
Server server1 = component.getServers().add(Protocol.HTTPS,
"localhost", 8080);
Series<Parameter> param1 = server1.getContext().getParameters();
param1.add("sslContextFactory","com.noelios.restlet.ext.ssl.PkixSslContextFactory");
param1.add("keystorePath","/path/to/keystore1.p12");
param1.add("keystorePassword","...");
param1.add("keystoreType","PKCS12");
//...
Server server2 = component.getServers().add(Protocol.HTTPS,
"localhost", 8082);
Series<Parameter> param2 = server2.getContext().getParameters();
param2.add("sslContextFactory","com.noelios.restlet.ext.ssl.PkixSslContextFactory");
param2.add("keystorePath","/path/to/keystore2.p12");
//...
You'll find an up-to-date list of parameters described in [2]. In
particular, if you are using the same keystore, you should be able to
choose an alias for a given context using the 'sslServerAlias' parameter.
These changes should be in Restlet 1.1-M5 when it's out (I think it's
going to be soon).
Best wishes,
Bruno.
[1] http://restlet.tigris.org/servlets/ReadMsg?list=discuss&msgNo=5711
[2] http://restlet.tigris.org/servlets/ReadMsg?list=discuss&msgNo=5886
Bruce Lee wrote:
Hi,
I'm trying to setup a host with the following address but have different
certificate.
https://localhost:8080
https://localhost:8082
My problem is although the server connectors seems to start correctly, when I
check the certificate for each of the site, it shows the same certificate. I'm
not sure if I need to setup something else.
I'm using Restlet 1.0.10 with Jetty connector and here is how I setup my
connectors.
component = new Component();
// setting up server connectors
ServerList serverConnectors = component.getServers();
Server server = serverConnectors.add(Protocol.HTTPS, "localhost", 8080);
// setup first certificates
--- server.getContext().getParameters().add( etc etc
server = serverConnectors.add(Protocol.HTTPS, "localhost", 8082);
// setup second certificates
--- server.getContext().getParameters().add( etc etc
component.getDefaultHost().attach("/", router);
component.start();