code:     public String getSessionId()
          throws IOException {
          // Look up the current SSLSession
          SSLSession session = ssl.getSession();
          if (session == null)
              return null;
          // Expose ssl_session (getId)
          byte [] ssl_session = session.getId();
          if ( ssl_session == null) 
              return null;
          StringBuffer buf=new StringBuffer("");
          for(int x=0; x<ssl_session.length; x++) {
              String digit=Integer.toHexString((int)ssl_session[x]);
              if (digit.length()<2) buf.append('0');
              if (digit.length()>2) digit=digit.substring(digit.length()-2);
              buf.append(digit);
          }
          return buf.toString();
      }
  
  
  