Hi,

Stefan Meissner wrote:
> Hi,
> 
>> However, the SSL sessions have nothing to do with the Servlet's session 
>> (and they're unlikely to be suitable as a replacement for such sessions 
>> anyway). 
> 
> I was afraid it's not the same. What I need is an equivalent to: 
> 'javax.servlet.request.ssl_session'
> 
>> I'd guess what you get is an enumeration of byte arrays, not Strings. An 
>> hexadecimal serialisation into string would probably be more 
>> appropriate. This being said, you won't necessarily get the right ID 
>> from this enumeration if there's more than one. Passing the SSLContext 
>> to your resources doesn't sound like good design either (again, it 
>> depends on what you do).
> 
> If I print out the pure ID out of the byte array I get this: [...@e51b2c 
> which looks like an hex address to me. How can I get to the value then?

Not sure how much experience you have with Java, but it doesn't really 
have the notion of addresses. "[...@e51b2c" is just the default output of 
toString() on an array object:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()

I'd suggest searching for Java byte array to hex conversion if you want 
an string representing the values in your array in hexadecimal (same 
format as used by javax.servlet.request.ssl_session).


> Anyway, in many of the cases of request there is no ID available at all. 
> That's why I also think the SSL session context is not approriate here.

As I said, it's not absurd want to expose the SSL session ID as a 
Request parameter (in the same was as client certificates and cipher 
suites are exposed). I could try to provide a patch to do so (if Jerome 
and Thierry are happy with it).

What I'm still not clear about is what you're trying to do with it here 
(I don't how well you know SSL/TLS). Whether with Restlets or Servlets, 
it doesn't seem right to use that for maintaining some sort of 
application session.


Best wishes,

Bruno.

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

Reply via email to