Jump to content

Joe Sansalone

Members
  • Content Count

    92
  • Joined

  • Last visited

Posts posted by Joe Sansalone


  1. Now that logging is enabled on the OnException event handler of TIdHTTPServer,

    I'm seeing all sorts of different exceptions.  

     

    However, the application is responding correctly.

    These are other "bad" requests hitting the server.

     

    I guess this is normal?  

     

    Below is part of the log:

     

     

    [HTTP          : Exception 08/10 07:01:51.935] OnException: Error accepting connection with SSL.
    EOF was observed that violates the protocol

    [HTTP          : Exception 08/10 07:45:07.863] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:08.035] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:08.113] OnException: Error accepting connection with SSL.
    error:1408A0C1:SSL routines:ssl3_get_client_hello:no shared cipher
    [HTTP          : Exception 08/10 07:45:08.379] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:08.582] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:08.738] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:08.926] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:09.113] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:09.348] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:09.567] OnException: Socket Error # 10054
    Connection reset by peer.
    [HTTP          : Exception 08/10 07:45:29.097] OnException: Connection Closed Gracefully.
    [HTTP          : Exception 08/10 08:05:17.495] OnException: Connection Closed Gracefully.
    [HTTP          : Exception 08/10 08:33:29.720] OnException: Error accepting connection with SSL.
    error:1408A10B:SSL routines:ssl3_get_client_hello:wrong version number
    [HTTP          : Exception 08/10 09:01:26.542] OnException: Error accepting connection with SSL.
    EOF was observed that violates the protocol
    [HTTP          : Exception 08/10 09:41:58.993] OnException: Error accepting connection with SSL.
    error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
    [HTTP          : Exception 08/10 09:57:41.154] OnException: Connection Closed Gracefully.


  2. 40 minutes ago, Remy Lebeau said:

    Hang/deadlock rather than timeout, but yes, if you are not careful with it.

    I'll review my code looking for possible problems with synchronization (although I remember being careful when writing it).

     

    The production application now has logging on OnException, OnCommendError, OnHeadersAvailable, OnConnect.

    And using the updated SSL DLLs.

     

    So I'll wait and see if it happens again.  

     


  3. I'm using Indy 10.6.2.0 that came with Delphi 10.4.2.

     

    Details on error from Twilio:

    SSL/TLS Handshake Error

    An attempt to retrieve content from https://live.projectone.ca/Phone returned the HTTP status code 502

    During SSL/TLS negotiation, Twilio experienced a connection reset.

     

    12 hours ago, Remy Lebeau said:

    Any synchronization between threads being done?

     

    Yes, there's some synchronization.  I'm pretty sure I put some timeouts to make sure 

    that it returns.   You bring up a good point.  I'm assuming you are suggesting that

    synchronization can cause the OnCommand events to timeout, correct?  Which could

    be a problem.  


  4. I'm using Indy 10.6.2.0.

    The OpenSSL DLLs were more than a year old, so I just updated the DLLs today with 1.0.2u version (Jun 25, 2021).

    I'm hoping these new DLLs might solve the problem - I later learned that Twilio server error logs indicated that a problem occurred 

    during the TLS handshaking.   Twilio servers send requests to my HTTP(S) application server.

     

    I am using the OnQuerySSLPort event.  I only return True (use SSL) for the 443 port.

     

    I didn't get a chance to use Wireshark when the problem happened.

    If it happens again, I will.

     

    My OnCommand events do not create any object.  They use pre-created objects

    with pre-connected database connections to handle requests.  I was careful to make

    sure the code is thread-safe.  In general, all requests are handled by separate threads 

    anyway (pooled).

     

    Thanks for pointing out OnConnect, OnHeadersAvailable events ... 

    I'll put some code there to log info so that the next time it happens, I'll see more.

    Also, OnException/OnCommandError ... I'll put some logging code.

     

    Thanks for your help.

     

    I will write again - either saying it's fixed OR if it happens again 

    I'll update this thread with more logging information.

     

    Joe

     

     


  5. (Currently trying with updated openssl DLL files to see if it fixes the problem .. although I need to wait a while to know for sure)

     

    In the meantime ...

     

    Hi,

     

    When testing a Indy Server application everything was fine.

    Now in production, it stops responding to requests after a while.

     

    Is it ok to bind multiple ports like this?  (should bind to the same default IP, right?)

     

    if not FServer.Active then
      begin
        FServer.Bindings.Clear;
        FServer.Bindings.Add.Port := 443;
        FServer.DefaultPort := StrToInt(EditPort.Text);
        FServer.Bindings.Add.Port := 80;
        FServer.Bindings.Add.Port := 8080;  // for testing
        FServer.Active := True;
      end;

     

     

    Another question:

     

    If an exception occurs in the OnCommandGet of the server and is not handled, would this screw things up for Indy HTTP server?

     

    Am I fine as long as I set this before end of OnCommandGet? 

        AResponseInfo.ResponseNo := 200;
        AResponseInfo.ContentText := 'OK';  // or whatever appropriate response here
        AResponseInfo.ContentType := 'text/html;charset="UTF-8"'; 

     

     

    What else could I be doing to get IdHTTPServer to stop responding to requests?

     

    Thanks,

    Joe

     

     

     


  6. Hi,

    I've encountered something weird.  Delphi 10.4.2

    I loop through the items in a list.

    But also may add to that list in the loop.

    Thus, extend the loop iterations.

     

    var

    list: TStringList;

     

    for i := 0 to list.count-1 do 

    begin

      // whatever processing

      list.append('another item');

    end

     

    PROBLEM:  the loop does not continue past the initial count.

     

    I'm guessing this is a BUG?

     

    Help,

    Joe

     

     

     

     


  7. Hi,

     

    A few years ago at CodeRage X, Pawel Glowacki extended the CloudAPI amazon service by coding up

    the Amazon Simple Notification Service (SNS).

     

    He provided a link to his source code ... but all the links on the web are broken.

     

    Does anyone know where to find his source?

     

    Joe


  8. Hi,

     

    I'm starting to use AWS (Amazon Web Services) more and more.

    And I store a snapshot of the entire drive so I can quickly launch

    another computer instance with the same Windows, Interbase and Delphi created 

    application.  (in case I need to).

     

    I know that some database servers licenses are tied to the specific CPU or computer.

     

    Does this apply to Interbase too?

     

    Joe

     

     


  9. I'm also waiting for the M1X (or M2) macbook pro 16 inch.  I suspect that the SSD problem is 

    one of too little RAM - way too much swapping going on.   This shouldn't be a problem

    on 16GB+ RAM systems.  

    I'm hoping the next generation is ready in the next couple of months.

     

     


  10. Hi,

     

    I'm looking to get a macbook pro (M1) and run Windows 

    under Parallels to develop using the Delphi IDE.

     

    Not sure Windows/Parallels is fully ready for the M1 macbook.

    But I was wondering if any developer has tried this OR if there's 

    anyone from Embarcadero looking into this ... to make sure it'll work.

     

    Any info would be appreciated.

     

    Joe

×