Problem trying to read an SSL server socket stream using readByte().

Hi I'm trying to read an SSL server socket stream using readByte(). I need to use readByte() because my program acts an LDAP proxy (receives LDAP messages from an LDAP client then passes them onto an actual LDAP server. It works fine with normal LDAP data streams but once an SSL data stream is introduced, readByte just hangs! Here is my code.....
help!!! anyone?... anyone?
1. SSL Socket is first read into  " InputStream input"
public void     run()
          Authorization     auth = new Authorization();
          try     {
               InputStream     input     =     client.getInputStream();
               while     (true)
               {     StandLdapCommand command;
                    try
                         command = new StandLdapCommand(input);
                         Authorization     t = command.get_auth();
                         if (t != null )
                              auth = t;
                    catch( SocketException e )
                    {     // If socket error, drop the connection
                         Message.Info( "Client connection closed: " + e );
                         close( e );
                         break;
                    catch( EOFException e )
                    {     // If socket error, drop the connection
                         Message.Info( "Client connection close: " + e );
                         close( e );
                         break;
                    catch( Exception e )
                         //Way too many of these to trace them!
                         Message.Error( "Command not processed due to exception");
                         close( e );
                                        break;
                                        //continue;
                    processor.processBefore(auth,     command);
                                try
                                  Thread.sleep(40); //yield to other threads
                                catch(InterruptedException ie) {}
          catch     (Exception e)
               close(e);
2 Then data is sent to an intermediate function 
from this statement in the function above:   command = new StandLdapCommand(input);
     public StandLdapCommand(InputStream     in)     throws IOException
          message     =     LDAPMessage.receive(in);
          analyze();
Then finally, the read function where it hangs at  "int tag = (int)din.readByte(); "
public static LDAPMessage receive(InputStream is) throws IOException
    *  LDAP Message Format =
    *      1.  LBER_SEQUENCE                           --  1 byte
    *      2.  Length                                  --  variable length     = 3 + 4 + 5 ....
    *      3.  ID                                      --  variable length
    *      4.  LDAP_REQ_msg                            --  1 byte
    *      5.  Message specific structure              --  variable length
    DataInputStream din = new DataInputStream(is);
       int tag = (int)din.readByte();      // sequence tag// sequence tag

I suspect you are actually getting an Exception and not tracing the cause properly and then doing a sleep and then getting another Exception. Never ever catch an exception without tracing what it actually is somewhere.
Also I don't know what the sleep is supposed to be for. You will block in readByte() until something comes in, and that should be enough yielding for anybody. The sleep is just literally a waste of time.

Similar Messages

  • Problems reading  an SSL server socket stream using readByte()

    Hi I'm trying to read an SSL server socket stream using readByte(). I need to use readByte() because my program acts an LDAP proxy (receives LDAP messages from an LDAP client then passes them onto an actual LDAP server. It works fine with normal LDAP data streams but once an SSL data stream is introduced, readByte just hangs! Here is my code.....
    help!!! anyone?... anyone?
    1. SSL Socket is first read into  " InputStream input"
    public void     run()
              Authorization     auth = new Authorization();
              try     {
                   InputStream     input     =     client.getInputStream();
                   while     (true)
                   {     StandLdapCommand command;
                        try
                             command = new StandLdapCommand(input);
                             Authorization     t = command.get_auth();
                             if (t != null )
                                  auth = t;
                        catch( SocketException e )
                        {     // If socket error, drop the connection
                             Message.Info( "Client connection closed: " + e );
                             close( e );
                             break;
                        catch( EOFException e )
                        {     // If socket error, drop the connection
                             Message.Info( "Client connection close: " + e );
                             close( e );
                             break;
                        catch( Exception e )
                             //Way too many of these to trace them!
                             Message.Error( "Command not processed due to exception");
                             close( e );
                                            break;
                                            //continue;
                        processor.processBefore(auth,     command);
                                    try
                                      Thread.sleep(40); //yield to other threads
                                    catch(InterruptedException ie) {}
              catch     (Exception e)
                   close(e);
    2 Then data is sent to an intermediate function 
    from this statement in the function above:   command = new StandLdapCommand(input);
         public StandLdapCommand(InputStream     in)     throws IOException
              message     =     LDAPMessage.receive(in);
              analyze();
    Then finally, the read function where it hangs at  "int tag = (int)din.readByte(); "
    public static LDAPMessage receive(InputStream is) throws IOException
        *  LDAP Message Format =
        *      1.  LBER_SEQUENCE                           --  1 byte
        *      2.  Length                                  --  variable length     = 3 + 4 + 5 ....
        *      3.  ID                                      --  variable length
        *      4.  LDAP_REQ_msg                            --  1 byte
        *      5.  Message specific structure              --  variable length
        DataInputStream din = new DataInputStream(is);
           int tag = (int)din.readByte();      // sequence tag// sequence tag

    I suspect you are actually getting an Exception and not tracing the cause properly and then doing a sleep and then getting another Exception. Never ever catch an exception without tracing what it actually is somewhere.
    Also I don't know what the sleep is supposed to be for. You will block in readByte() until something comes in, and that should be enough yielding for anybody. The sleep is just literally a waste of time.

  • Reading text from server socket stream

    I have a basic cd input program i've been trying to figure out the following problem for a while now, the user enters the artist and title etc and then a DOM (XML) file is created in memory this is then sent to the server. The server then echos back the results which is later printed on a html page by reading the replys from the server line by line.
    The server must be run it listens for clients connecting the clients connect and send DOM documents through the following jsp code.
    <%@page import="java.io.*"%>
    <%@page import="java.net.*"%>
    <%@page import="javax.xml.parsers.*"%>
    <%@page import="org.w3c.dom.*"%>
    <%@page import="org.apache.xml.serialize.*"%>
    <%!
       public static final String serverHost = "cdserver";
       public static final int serverPort = 10151;
    %>
    <hr />
    <pre>
    <%
            Socket mySocket = null;          // socket object
            PrintWriter sockOut = null;      // to send data to the socket
            BufferedReader sockIn = null;    // to receive data from the socket
            try {
                //  #1 add line that creates a client socket
                mySocket = new Socket(serverHost, serverPort);
                // #2 add lines that create input and output streams
                //            attached to the socket you just created
                 sockOut = new PrintWriter(mySocket.getOutputStream(), true);
                 sockIn = new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
            } catch (UnknownHostException e) {
                throw e; // This time the JSP can handle the exception, not us
            } catch (IOException e) {
                throw e; // This time the JSP can handle the exception, not us
    String cdTitle, cdArtist, track1Title, track1Time, track1Rating;
    // Retrieve the HTML form field values
    cdTitle = request.getParameter("cdtitle");
    cdArtist = request.getParameter("cdartist");
    track1Title = request.getParameter("track1title");
    track1Time = request.getParameter("track1time");
    track1Rating = request.getParameter("track1rating");
    // Create a new DOM factory, and from that a new DOM builder object
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    // Note that we are creating a new (empty) document
    Document document = builder.newDocument();
    // The root element of our document wil be <cd>
    // It gets stored as the child node of the whole document (it is the root)
    Element rootElement = document.createElement("cd");
    document.appendChild(rootElement);
    // Create an element for the CD title called <title>
    Element cdTitleElement = document.createElement("title");
    // Add a text code under the <title> element with the value that
    // the user entered into the title field of the web form (cdTitle)
    cdTitleElement.appendChild(document.createTextNode(cdTitle));
    // Place the <title> element underneath the <cd> element in the tree
    rootElement.appendChild(cdTitleElement);
    // Create an <artist> element with the form data, place underneath <cd>
    Element cdArtistElement = document.createElement("artist");
    cdArtistElement.appendChild(document.createTextNode(cdArtist));
    rootElement.appendChild(cdArtistElement);
    // Create a <tracklist> element and place it underneath <cd> in the tree
    // Note that it has no text node associated with it (it not a leaf node)
    Element trackListElement = document.createElement("tracklist");
    rootElement.appendChild(trackListElement);
    // In this example we only have one track, so it is not necessary to
    // use a loop (in fact it is quite silly)
    // But the code below is included to demonstrate how you could loop
    // through and add a set of different tracks one by one if you
    // needed to (although you would need to have the track data already
    // stored in an array or a java.util.Vector or similar
    int numTracks = 1;
    for (int i=0; i<numTracks; i++) {
      String trackNum = Integer.toString(i+1);
      Element trackElement = document.createElement("track");
      trackElement.setAttribute("id", trackNum);
      trackListElement.appendChild(trackElement);
      // Track title element called <title>, placed underneath <track>
      Element trackTitleElement = document.createElement("title");
      trackTitleElement.appendChild(document.createTextNode(track1Title));
      trackElement.appendChild(trackTitleElement);
      // Track time element called <time>, placed underneath <track>
      Element trackTimeElement = document.createElement("time");
      trackTimeElement.appendChild(document.createTextNode(track1Time));
      trackElement.appendChild(trackTimeElement);
      // Track rating element called <rating>, placed underneath <track>
      Element trackRatingElement = document.createElement("rating");
      trackRatingElement.appendChild(document.createTextNode(track1Rating));
      trackElement.appendChild(trackRatingElement);
    OutputFormat format = new OutputFormat();
    format.setIndenting(true);
    // Create a new XMLSerializer that will be used to write out the XML
    // This time we will serialize it to the socket
    // #3 change this line so that it serializes to the socket,
    // not to the "out" object
    XMLSerializer serializer = new XMLSerializer(writer, format);
    serializer.serialize(document);
            // Print out a message to indicate the end of the data, and
            // flush the stream so all the data gets sent now
            sockOut.println("<!--QUIT-->");
            sockOut.flush();
            BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
            String fromServer;
            String fromUser;
             #4 add a while loop that reads text from the
            server socket input stream, line by line, and prints
            it out to the web page, using out.println(...);
            Note that because the reply from the server will contain
            XML, you will need to call upon the toHTMLString() method
            defined below to escape the < and > symbols so that they
            will display correctly in the web browser.
            Also note that as you receive the reply back from the
            server, you should look out for the special <!--QUIT-->
            string that will indicate when there is no more data
            to receive.
            while ((fromServer = sockIn.readLine()) != null) {
            out.println(sockIn.readLine());
                // If the reply from the server said "QUIT", exit from the
                // while loop by using a break statement.
                if (fromServer.equals("QUIT")) {
                    out.println("Connection closed - good bye ...");
                // Print the text from the server out to the user's screen
                out.println("Reply from Server: " + fromServer);
                // Now read a line of text from the keyboard (typed by user)
                fromUser = stdIn.readLine();
                // If it wasn't null, print it out to the screen, and also
                // print a copy of it out to the socket
                if (fromUser != null) {
                    out.println("Client: " + fromUser);
                    sockOut.println(fromUser);
            // Close all the streams we have open, and then close the socket
            sockOut.close();
            sockIn.close();
            mySocket.close();
    %>
    I'm suppose to modify the commented sections labled with #.
    #1,2 are correct but i have doubts on the 3rd and 4th modification.
    for #3 i changed so i serializes to the socket not to the "out" object:
    from
    XMLSerializer serializer = new XMLSerializer(out, format);
    to
    XMLSerializer serializer = new XMLSerializer(writer, format);
    with "out" it prints out some of the results entered but it just hangs i'm thinking it might be the while loop that i added in #4. If i changed it to serialize the socket XMLSerializer serializer = new XMLSerializer(writer, format); it doesn't print out nothing at all; just a blank screen where it hangs.
    I can post the rest of the code (server thats in java and cdinput.html) but since i want to keep my post short and if required i'll post it later on i also omitted some of the code where it creates the DOM textnodes etc to keep my post short.

    On your previous thread, why did you say the server was using http POST and application/xml content type when it quite obviously isn't, but a direct socket communication that abuses XML comments for message end delimiters?
    The comments imply you need to wait for "<!--QUIT-->" on a line by itself, but your loop is waiting for "QUIT".
    Pete

  • Problems Reading SSL  server socket  data stream using readByte()

    Hi I'm trying to read an SSL server socket stream using readByte(). I need to use readByte() because my program acts an LDAP proxy (receives LDAP messages from an LDAP client then passes them onto an actual LDAP server. It works fine with normal LDAP data streams but once an SSL data stream is introduced, readByte just hangs! Here is my code.....
    help!!! anyone?... anyone?
    1. SSL Socket is first read into  " InputStream input"
    public void     run()
              Authorization     auth = new Authorization();
              try     {
                   InputStream     input     =     client.getInputStream();
                   while     (true)
                   {     StandLdapCommand command;
                        try
                             command = new StandLdapCommand(input);
                             Authorization     t = command.get_auth();
                             if (t != null )
                                  auth = t;
                        catch( SocketException e )
                        {     // If socket error, drop the connection
                             Message.Info( "Client connection closed: " + e );
                             close( e );
                             break;
                        catch( EOFException e )
                        {     // If socket error, drop the connection
                             Message.Info( "Client connection close: " + e );
                             close( e );
                             break;
                        catch( Exception e )
                             //Way too many of these to trace them!
                             Message.Error( "Command not processed due to exception");
                             close( e );
                                            break;
                                            //continue;
                        processor.processBefore(auth,     command);
                                    try
                                      Thread.sleep(40); //yield to other threads
                                    catch(InterruptedException ie) {}
              catch     (Exception e)
                   close(e);
    2 Then data is sent to an intermediate function 
    from this statement in the function above:   command = new StandLdapCommand(input);
         public StandLdapCommand(InputStream     in)     throws IOException
              message     =     LDAPMessage.receive(in);
              analyze();
    Then finally, the read function where it hangs at  "int tag = (int)din.readByte(); "
    public static LDAPMessage receive(InputStream is) throws IOException
        *  LDAP Message Format =
        *      1.  LBER_SEQUENCE                           --  1 byte
        *      2.  Length                                  --  variable length     = 3 + 4 + 5 ....
        *      3.  ID                                      --  variable length
        *      4.  LDAP_REQ_msg                            --  1 byte
        *      5.  Message specific structure              --  variable length
        DataInputStream din = new DataInputStream(is);
        int tag = public static LDAPMessage receive(InputStream is) throws IOException
        *  LDAP Message Format =
        *      1.  LBER_SEQUENCE                           --  1 byte
        *      2.  Length                                  --  variable length     = 3 + 4 + 5 ....
        *      3.  ID                                      --  variable length
        *      4.  LDAP_REQ_msg                            --  1 byte
        *      5.  Message specific structure              --  variable length
        DataInputStream din = new DataInputStream(is);
           int tag = (int)din.readByte();      // sequence tag// sequence tag
        ...

    I suspect you are actually getting an Exception and not tracing the cause properly and then doing a sleep and then getting another Exception. Never ever catch an exception without tracing what it actually is somewhere.
    Also I don't know what the sleep is supposed to be for. You will block in readByte() until something comes in, and that should be enough yielding for anybody. The sleep is just literally a waste of time.

  • SSL Server Socket and j2me

    I make a SSL Server Socket. I want that a cell connect to it for take data. I have to make Certificate form my server. this is for a Stage so I can't pay for certificate. If I make my self signed cert can I install it to a cell or this operation is blocked?

    Sorry, I make an SSL Server Socket using java and this server stays on a pc.

  • SSL Server socket: controlling the alias for the server certificate ?

    Hi,
    Could anyone please clear up the following ?
    When you create an SSL server socket, it needs a certificate (to prove its identity), and for this it relies on a keystore:
    System.setProperty("javax.net.ssl.keyStore", "c:/mystore");
    My question is, what if the keystore contains several certificates ?
    Eg:
    keytool -import -alias AAA -file cert1.cer -keystore mystore
    keytool -import -alias BBB -file cert2.cer -keystore mystore
    Which certificate would the server use ?
    And is there a way to control the alias it would use ?
    Thanks :)

    This is a very good question and one that should be described in the Guide to Features. See javax.net.ssl.X509KeyManager.chooseServerAlias(). It does a search looking for aliases of a given key type, i.e. one of the ones the peer understands, & which are trusted by the peer. Any alias which the peer can accept will do.

  • Socket Exception when closing Server Socket Streams if Client closes first

    Hi
    I have 2 processes - a Server socket and a client socket. If I close the Client process first, and then try closing down the Streams on the Server process, I get a SocketException with message "Socket is closed" when I try and close the 2nd Stream. It does not matter on the order of the Stream being closed down, the exception is always thrown when I try and close the second stream. The code snippets are below:
    SERVER =======
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class ServerSocketTest {
    public static void main(String args[]) {
    try {
    ServerSocket ss = new ServerSocket(9999);
    Socket s = ss.accept();
    // Get refs to streams...
    InputStream is = s.getInputStream();
    OutputStream os = s.getOutputStream();
    // sleep to let client shutdown first...
    try {
    Thread.sleep(10000);
    } catch (InterruptedException e) {
    System.err.println(e);
    System.err.println("B4 inClose: isBound=" + s.isBound());
    System.err.println("B4 inClose: isClosed=" + s.isClosed());
    System.err.println("B4 inClose: isConnected=" + s.isConnected());
    System.err.println("B4 inClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("B4 inClose: isOutputShutdown=" + s.isOutputShutdown());
    s.getInputStream().close();
    System.err.println("After inClose: isBound=" + s.isBound());
    System.err.println("After inClose: isClosed=" + s.isClosed());
    System.err.println("After inClose: isConnected=" + s.isConnected());
    System.err.println("After inClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("After inClose: isOutputShutdown=" + s.isOutputShutdown());
    s.getOutputStream().close(); // will break here with SocketException!
    System.err.println("After outClose: isBound=" + s.isBound());
    System.err.println("After outClose: isClosed=" + s.isClosed());
    System.err.println("After outClose: isConnected=" + s.isConnected());
    System.err.println("After outClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("After outClose: isOutputShutdown=" + s.isOutputShutdown());
    s.close();
    } catch (Exception e) {
    System.err.println(e);
    CLIENT ======
    import java.net.Socket;
    public class ClientSocket {
    public static void main(String args[]) {
    try {
    Socket s = new Socket("localhost", 9999);
    try {
    // sleep to leave connection up for a while...
    Thread.sleep(2000);
    } catch (InterruptedException e) {
    System.err.println(e);
    s.close();
    } catch (Exception e) {
    System.err.println(e);
    The debug shows that isClosed() is set to 'true' after the first call to s.getInputStream().close(). The Sun API Socket class getOutputStream() has a call to isClosed() at the start of the method - it then throws the SocketException that I get. Why does the SocketImpl do this before I get a chance to call a.getOutputStream().close()?
    One final thing, the calls to s.isInputShutdown() and s.isOuputShutdown always seem to return false even if the Streams have had their .close() method called.
    Any ideas/help here greatly appreciated.
    Thanks
    Gaz

    Ok, I know what's going on now - I needed something to do on Friday afternoon anyhow!
    Basically if you call either getOutputStream.close() or getInputStream().close(), the underlying Sun implementation will close the Socket.
    Here's what's happening under the covers in the Sun code:
    s.getInputStream() is called on the Socket class.
    The Socket class holds a reference to the SocketImpl class.
    The SocketImpl class is abstract and forces sublclasses to extend it' s getInputStream() method.
    The PlainSocketImpl extends SocketImpl.
    PlainSocketImpl has a getInputStream() method that returns a SocketInputStream. When the stream is created for the first time, the PlainSocketImpl object is passed into the Constructor.
    The SocketInputStream class has a close() method on it. The snippet of code below shows how the socket is closed:
    <pre>
    * Closes the stream.
    private boolean closing = false;
    public void close() throws IOException {
         // Prevent recursion. See BugId 4484411
         if (closing)
         return;
         closing = true;
         if (socket != null) {
         if (!socket.isClosed())
              socket.close();
         } else
         impl.close();
         closing = false;
    </pre>
    So, it seems that out PlainSocketImpl is getting closed for us, hence the SocketException being thrown in Socket.getOutputStream() when I call it after Socket.getInputStream()/
    I've not had a look at the reason why the calls to s.isInputShutdown() and s.isOuputShutdown always seem to return false even if the Streams have had their .close() method called though - any thoughts appreciated.
    Thanks
    G

  • GUI locks up when trying to read output from server

    I have a client built in MVC fashion and have two GUI views. One view is for output from the server and input from the keyboard. The other view is for changing connection settings and starting the conection. The problem is when I make the call to connect from the connection GUI it is able to connect and set up the streams but both GUIs lock up once I start trying to output the text received from the server. The strange thing is that when I call these methods just from the Model and not via the GUI and its actionListener the whole thing works. I think it may have something to do with the loop locking up the GUI but don't how to resolve this.
    public void monitorServer()
    try
    char inputChar = (char)fromServer.read();
    while (socket.isConnected()==true && inputChar >-1 )
    inputChar = (char)fromServer.read();
    if ( ( (inputChar >= '0') && (inputChar <= 'z') )
    ||(inputChar == '\n')||(inputChar == '\r')
    ||(inputChar == ' ') )
    String tempString = (""+inputChar);
    mv.addText(tempString);
    catch(IOException ioException)
    JOptionPane.showMessageDialog(null,
    "Error: Failed to read message. Corrupt data sent by server",
    "Connection Error", JOptionPane.ERROR_MESSAGE);
    mv.addText("\nMessage not read.\n");
    The code above is the bot that screws it all up. mv is the other view that it is outputting the text to.
    Please help! I'm gonna fail my degree. :)

    you need to run your server connection part in another thread.

  • Problem trying to get Indesign CC Server Trial up and running on my server.

    ive read up a bit on this and its suggest doing a command line script in windows but i get the error " Adobe InDesign Server is not properly licensed and will now quit" - does anyone have a solution ??
    any help appreciated - ive been through the threads but to no avail. the adobe_prtk.exe  give me an response of "1" after i run it.
    please help
    thanks
    CG

    Hi csgraham74,
    What operating system you are working and What version of IDS you have.
    Please confirm the commnad you using(without serial number) to license InDesign Server using Adobe Provisioning TooolKit for Enteerprise Edition(APTEE).
    Make sure you are not having any typo.
    Please find the online documentation on “Release notes InDesign Sever CS6”.
    http://helpx.adobe.com/indesign/release-note/indesign-server-cs6-release-notes.html#id_277 82
    This documentation involves the instruction on how to activate license of InDesign Server CS6 using additional method
    When you are facing licensing issue. 
    You need to follow the instructions provided in “Activate Trial using APTEE”.
    Hope this helps.
    Please let me know in case of any problem.
    Regards,
    Sumit Singh

  • Problems trying to migrating ports to a new Vlan using an externar DHCP server

    Hello, here is the thing. I have the following configuration in my Core Switch:
    interface Vlan1
     ip address 10.24.74.1 255.255.254.0 secondary
     ip address 192.0.2.54 255.255.255.0
     ip helper-address 10.24.86.22
     no ip redirects
    As you see, we are using an external DHCP server for the Vlan1 and it is working:
    Internet  192.0.2.98              0   3c97.0e23.3d8d  ARPA   Vlan1
    Internet  192.0.2.194             0   e89a.8f77.36a0  ARPA   Vlan1
    Internet  192.0.2.195             0   e89a.8f77.01ab  ARPA   Vlan1
    Internet  192.0.2.198             2   001c.25de.acaa  ARPA   Vlan1
    Internet  192.0.2.199             0   d8eb.97a6.30a4  ARPA   Vlan1
    Internet  192.0.2.196             0   f0de.f1f1.1e06  ARPA   Vlan1
    Internet  192.0.2.203             0   e89a.8f77.016f  ARPA   Vlan1
    Internet  192.0.2.207             4   d0c7.89d6.3ba3  ARPA   Vlan1
    Internet  192.0.2.211             0   4437.e636.7ef7  ARPA   Vlan1
    But, when a try to migrate this port to a new Vlan (Vlan50), I got the following issue: 
    001290: Jul 23 08:27:44.705 GMT: DHCPD: DHCPREQUEST received from client 013c.970e.233d.8d.
    001291: Jul 23 08:27:44.705 GMT: DHCPD: client has moved to a new subnet.
    001292: Jul 23 08:27:44.705 GMT: DHCPD: Sending DHCPNAK to client 013c.970e.233d.8d.
    001293: Jul 23 08:27:44.705 GMT: DHCPD: broadcasting BOOTREPLY to client 3c97.0e23.3d8d.
    001294: Jul 23 08:27:44.725 GMT: dhcp_snooping_get_ingress_port: Interface src_index 0xF
    001295: Jul 23 08:27:44.725 GMT: DHCPD: DHCPDISCOVER received from client 013c.970e.233d.8d on interface Vlan50.
    001296: Jul 23 08:27:44.725 GMT: DHCPD: there is no address pool for 10.24.76.1.
    001297: Jul 23 08:27:44.725 GMT: DHCPD: setting giaddr to 10.24.76.1.
    001298: Jul 23 08:27:44.725 GMT: DHCPD: BOOTREQUEST from 013c.970e.233d.8d forwarded to 10.24.86.21.
    Any suggestions,
    Thank you in advance,

    Just to help someone who has the same issue.
    I found this on the web site:
    When the server receives a DHCPREQUEST from a client in the RENEWING (or REBINDING) state, it normally grants the renewal only if the client has an unexpired lease with this server. Otherwise the server ignores the request; the server to which the client is bound should answer the client. (The only exception is normally that if a server is sure the IP address the client is asking for is inappropriate for the client, the server will send a DHCPNAK, which forces the client back to the INIT state.)
    Thank you anyway

  • Problem in installation of free SSL certificate on Weblogic using keytool

    We tried to install SSL certificate on weblogic certificate using Keystore ..but it is giving error in console at startup and server shutdowns automatically...
    Steps followed:-
    1) To generate keystore and private key and digital cerficate:-
    keytool -genkey -alias mykey2 -keyalg RSA -keystore webconkeystore.jks -storepass webconkeystorepassword
    2) To generate CSR
    keytool -certreq -alias mykey2 -file webconcsr1.csr -keyalg RSA -storetype jks -keystore webconkeystore.jks -storepass webconkeystorepassword
    3) CSR is uploaded on verisign site to generate free ssl certificate.All certificate text received is paste into file (cacert.pem)
    4) Same certificate is put into same keystore using following command
    keytool -import -alias mykey2 -keystore webconkeystore.jks -trustcacerts -file cacert.pem
    5) Before step 4), we have also installed root /intermediate certificate to include chain using following command.
    (intermediateCa.cer file is downloaded from verisign site)
    keytool -import -alias intermediateca -keystore webconkeystore.jks -trustcacerts -file intermediateCa.cer
    6) After this configuration we used weblogic admin module to configure Keystore and SSL.
    7) For KeyStore tab in weblogic admin module, we have select option “Custom Identity And Custom Trust” provided following details under Identity and Trust columns:-
    Private key alias: mykey2
    PassKeyphrase: webconkeystorepassword
    Location of keystore: location of webconkeystore.jks file on server
    8) For SSL tab in weblogic admin module, we have select option “KeyStores” for “Identity and Trust locations”.
    Error on console:
    <Nov 3, 2009 3:00:17 PM IST> <Emergency> <Security> <BEA-090034> <Not listening for SSL, java.io.IOException: Failed to retrieve identity key/certificate from keystore /home/cedera/bea9.0/weblogic90/server/lib/webconkeystore.jks under alias mykey2 on server AdminServer.>
    <Nov 3, 2009 3:00:17 PM IST> <Emergency> <Security> <BEA-090087> <Server failed to bind to the configured Admin port. The port may already be used by another process.>
    <Nov 3, 2009 3:00:17 PM IST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason: Server failed to bind to any usable port. See preceeding log message for details.>
    <Nov 3, 2009 3:00:17 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
    <Nov 3, 2009 3:00:17 PM IST> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
    <Nov 3, 2009 3:00:17 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>
    If anyone knows the solution ,please help us out.Thanx in advance.
    I was really happy to get reply yesterday from "mv".I was not expecting such instant response.

    Thanx all guys for your interest and support.
    I have solved this issue.
    We have weblogic 9 on unix env.
    Following steps which I followed:
    #generate private key
    keytool -genkey -v -alias uinbrdcsap01_apac_nsroot_net -keyalg RSA -keysize 1024 -dname "CN=linuxbox042, OU=ASIA, O=Citigroup, L=CALC, S=MH, C=IN" -validity 1068 -keypass "webconkeystorepassword" -keystore "cwebconkeystore"
    #generate csr
    keytool -certreq -v -alias uinbrdcsap01_apac_nsroot_net -file linuxbox042.csr -keypass "webconkeystorepassword" -keystore "cwebconkeystore" -storepass webconkeystorepassword
    Then we uploaded this csr on verisigns free ssl certificate to generate and receive certificate text.
    We copied that text file in "ert4nov2009.crt" rt file used below.
    Apart from that , mail which we received from verisign also contains links to download root ca certificate and intermediate ca certificate.We downloaded them.
    roo ca in "root4nov2009.cer" file.
    intermediate ca in "intermediateca4nov2009.cer"
    both these files used in
    #import root certificate
    keytool -import -alias rootca -keystore "cwebconkeystore" -storepass "webconkeystorepassword" -trustcacerts -file "root4nov2009.cer"
    #import intermediate ca certificate
    keytool -import -alias intermediateca -keystore "cwebconkeystore" -storepass "webconkeystorepassword" -trustcacerts -file "intermediateca4nov2009.cer"
    #install free ssl certifiate
    keytool -import -alias uinbrdcsap01_apac_nsroot_net -file "cert4nov2009.crt" -trustcacerts -keypass "webconkeystorepassword" -keystore "cwebconkeystore" -storepass "webconkeystorepassword"
    #after this admin configuration
    In weblogic admin console module, we did following settings:-
    1. under Configuration tab
    a. Under KeyStore tab
    For keystore , we selected "Custom identity and Custom Trust"
    Under Identity,
    Custom Identity Keystore:location of keystore "webconkeystore" on weblogic server
    Custom Identity Keystore Type: JKS
    Custom Identity Keystore Passphrase:password for keystore mentioend above.In our case, webconkeystorepassword
    Same we copied Under "Trust", as we have not created separate keystore for trust.
    Save setting.
    b. Under SSL tab
    Identity and Trust Locations: select "Keystores"
    Private Key Alias: alias used while creating private keyi.e. in our case "uinbrdcsap01_apac_nsroot_net"
    Save setting.
    c. Under General tab
    Check checkbox "SSL Listen Port Enabled"
    and mention ssl port "SSL Listen Port"
    Save setting.
    After this activate changes.You might see error on admin module.
    Using command prompt, stop the server and again restart and then try to access using https and port ...
    you will definately get output...
    in our case issue might be due to key size..we used 1024 key size ..it solve problem.
    for your further reference plz find link below..it is also helpful.
    http://download.oracle.com/docs/cd/E13222_01/wls/docs81/plugins/nsapi.html#112674

  • Re: Problem in playing audio/video from server to client using RTP and RTSP.

    Take a look through the links listed here
    http://forum.java.sun.com/thread.jspa?threadID=5151618&tstart=0
    try the sample applications - use bits fom them to build your aown App & post up any quetsions / problems you get as you go along
    And this link has some sample code you can look at to get the basics
    http://forum.java.sun.com/thread.jspa?messageID=9573675

    hello,
    1) if you want to develop a distributed application with XML messages, you can look in SOAP.
    it's a solution to communicate objects distributed java (or COM or other) and it constructs XML flux to communicate between them.
    2) if it can help you, I have developed a chat in TCP/IP and, to my mind, when you send datas it's only text, so the format isn't important, the important is your traitement behind.
    examples :
    a client method to send a message to the server :
    public void send(String message)
    fluxOut.println(message);
    fluxOut.flush();
    whith
    connexionCourante = new Socket(lAdresServeur, noPort);
    fluxOut= new PrintWriter( new OutputStreamWriter(connexionCourante.getOutputStream()) );
    a server method in a thread to receive and print the message :
    while(true)
    if (laThread == null)
    break;
    texte = fluxIn.readLine();
    System.out.println(texte);
    that's all ! :)
    If you want to use it for your XML communication, it could be a good idea to use a special message, for example "@end", to finish the server
    ex :
    while(true)
    if (laThread == null)
    break;
    texte = fluxIn.readLine();
    // to stop
    if (texte.equals("@end"))
    {break;}
    processMessage(texte );
    hope it will help you
    David

  • Client Server Socket With GUI

    Hi,
    As the name of the forum suggests I am very new to this whole thing.
    I am trying to write a client/server socket program that can encrypt and decrypt and has a GUI, can't use JCE or SSL or any built in encryption tools.
    I have the code for everything cept the encryption part.
    Any help, greatly appreciated,

    tnks a million but how do i incorporate that into the following client and server code:
    here's the client code:
    import java.awt.Color;
    import java.awt.BorderLayout;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.net.*;
    class SocketClient extends JFrame
              implements ActionListener {
    JLabel text, clicked;
    JButton button;
    JPanel panel;
    JTextField textField;
    Socket socket = null;
    PrintWriter out = null;
    BufferedReader in = null;
    SocketClient(){ //Begin Constructor
    text = new JLabel("Text to send over socket:");
    textField = new JTextField(20);
    button = new JButton("Click Me");
    button.addActionListener(this);
    panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBackground(Color.white);
    getContentPane().add(panel);
    panel.add("North", text);
    panel.add("Center", textField);
    panel.add("South", button);
    } //End Constructor
    public void actionPerformed(ActionEvent event){
    Object source = event.getSource();
    if(source == button){
    //Send data over socket
    String text = textField.getText();
    out.println(text);
         textField.setText(new String(""));
    //Receive text from server
    try{
         String line = in.readLine();
    System.out.println("Text received :" + line);
    } catch (IOException e){
         System.out.println("Read failed");
         System.exit(1);
    public void listenSocket(){
    //Create socket connection
    try{
    socket = new Socket("HUGHESAN", 4444);
    out = new PrintWriter(socket.getOutputStream(), true);
    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    } catch (UnknownHostException e) {
    System.out.println("Unknown host: HUGHESAN.eng");
    System.exit(1);
    } catch (IOException e) {
    System.out.println("No I/O");
    System.exit(1);
    public static void main(String[] args){
    SocketClient frame = new SocketClient();
         frame.setTitle("Client Program");
    WindowListener l = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.addWindowListener(l);
    frame.pack();
    frame.setVisible(true);
         frame.listenSocket();
    SERVER Code
    import java.awt.Color;
    import java.awt.BorderLayout;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.net.*;
    class SocketServer extends JFrame
              implements ActionListener {
    JButton button;
    JLabel label = new JLabel("Text received over socket:");
    JPanel panel;
    JTextArea textArea = new JTextArea();
    ServerSocket server = null;
    Socket client = null;
    BufferedReader in = null;
    PrintWriter out = null;
    String line;
    SocketServer(){ //Begin Constructor
    button = new JButton("Click Me");
    button.addActionListener(this);
    panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBackground(Color.white);
    getContentPane().add(panel);
    panel.add("North", label);
    panel.add("Center", textArea);
    panel.add("South", button);
    } //End Constructor
    public void actionPerformed(ActionEvent event) {
    Object source = event.getSource();
    if(source == button){
    textArea.setText(line);
    public void listenSocket(){
    try{
    server = new ServerSocket(4444);
    } catch (IOException e) {
    System.out.println("Could not listen on port 4444");
    System.exit(-1);
    try{
    client = server.accept();
    } catch (IOException e) {
    System.out.println("Accept failed: 4444");
    System.exit(-1);
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(client.getOutputStream(), true);
    } catch (IOException e) {
    System.out.println("Accept failed: 4444");
    System.exit(-1);
    while(true){
    try{
    line = in.readLine();
    //Send data back to client
    out.println(line);
    } catch (IOException e) {
    System.out.println("Read failed");
    System.exit(-1);
    protected void finalize(){
    //Clean up
    try{
    in.close();
    out.close();
    server.close();
    } catch (IOException e) {
    System.out.println("Could not close.");
    System.exit(-1);
    public static void main(String[] args){
    SocketServer frame = new SocketServer();
         frame.setTitle("Server Program");
    WindowListener l = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.addWindowListener(l);
    frame.pack();
    frame.setVisible(true);
         frame.listenSocket();
    Again help on this is very welcomed

  • Strust ssl server standard

    Hi,
    I am configuring y SSL PSE in strust.  Everything goes Green when I create my certificates.  When I double click on my "SSL Server Standard" at the bottom I see PSE Missing on database.  But if I click on it again it says "Local PSE OK" 
    If I run the program SSF_ALERT_CERTEXPIRE I see under standard
    "error during SSF Get: could not open PSE"
    "use the trust manager (transaction STRUST) for error analysis"
    After doing this I tried to delete the "SSL Server Standard" in strust but I get the error "PSE locked for changes"
    Any ideas on how I can either delete the PSE or fix my SSL Server Standard?
    By the way my SYSTEM PSE and SNC SAPCRryptolib look fine and tested without problems.  I even deleted them and re-added them without any problems.
    Thanks,
    Lee

    I regenerated the Certs and reapplied and the problem went away.  Not sure why but it's fixed.
    Lee

  • SSL Server without Server Cert

    The SSL specification http://wp.netscape.com/eng/ssl3/3-SPEC.HTM
    Section 7.5 Handshake protocol overview
    says
    That Server Certificates are optional. Is it possible in JSSE to create a SSL Server Socket and start accepting clients without a Server Certificate ?.
    Any samples/help appreciated.
    regards
    Rajesh

    Look here:
    http://forum.java.sun.com/thread.jsp?forum=2&thread=410373
    Good luck!
    Grant

Maybe you are looking for

  • SWF problem in Dreamweaver CS3 and strange Script file

    Hi folks, I am using Dreamweaver CS3 and tried to upload a SWF file today. The SWF includes three buttons, one for video, another for audio and one for text. Before loading up to DW all three parts played fine. But when I uploaded to DW and my site,

  • Can't check Lumia Amber update after hard reset no...

    Hi,I recently hard reset my phone , And I am having problem checking update in my phone it says error code : ******** . I have successfully updated my phone before I have hard reset it . Do you have a solution for this ?

  • ATI Radeon 9650 question

    I have an ATI Radeon 9650 taken out of my dual 2.7 G5, will this card work in my G4 Dual MDD 1.25? (not FW800)

  • Pure Virtual Function Call error

    Hello, I´m running a Labview exe with NI DAQ 7.4 and it´s working fine. the problem happens when I shutdown the computer. An error appears on the screen saying that nipalsm.exe has closed and commited a pure virtual error. I press OK and the system s

  • Pricing in CRM

    Hi All, What is the difference between Pricing in CRM 2007 and Pricing in CRM 5.0? Thanks Sonali