Is it possible to get the SSL session IDs using Simple HTTPS server connector?

Can the SSLSessionContext IDs be used in the same way as in servlet API like 
this:

String sslID = 
(String)request.getAttribute("javax.servlet.request.ssl_session");

What I did so far:

Server server = component.getServers().add(Protocol.HTTPS, 8183);
Series<Parameter> param = server.getContext().getParameters();

param.add("keystorePath", "./mySrvKeystore");
param.add("keystorePassword", "123456");
                
HttpsServerHelper helper = new HttpsServerHelper(server);
                
SSLContext sslContext;
try {
        helper.start();
        sslContext = helper.getSslContext();

Enumeration<byte[]> sessionIDs = sslcontext.getServerSessionContext().getIds();

component.getDefaultHost().attach(new FilterApplication(sslContext));
                        
// Start the component.
component.start();
                        
} catch (Exception e) {
                                e.printStackTrace();
}

I also called the getIds() method inside the FilterApplication (beforeHandle), 
but in most of the cases there is no session ID present upon request. And if 
there is one ID it contains weird characters such as the follwing 
session ID: K?>7?%?[?s?#1GGb&?2???^?a??

I've tried several charsets using:
String sID = new String(id,"UTF-8");
but I never get a better representation of the ID.

Can someone please give me a clue what I'm doing wrong.

Best regards
Stefan

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2451587

Reply via email to