Jump to content

Angus Robertson

Members
  • Content Count

    1702
  • Joined

  • Last visited

  • Days Won

    32

Posts posted by Angus Robertson


  1. Quote

    How to download DLLs from internet from a https site, without SSL DLLs present

    That was fixed in V9.1, or at least there are now settings that allow the HTTP clients to be used without SSL being available, for http:// only.

     

    I go to extreme lengths to keep ICS backward compatible, I know how horrible it is updating to new compilers and components when you get blizzards or IDE error messages on opening old projects, it's why some of my projects are still Delphi 2007. 

     

    Rarely backward compatible is not possible, but I did spend a week or two writing documentation and updating samples explaining how to update to V9.1. 

     

    Angus

     


  2. The default defines are designed so that users get new applications working easily and safely, without them failing immediately because the OpenSSL DLLs can not be found.  Or needing to copy those DLLs into every single different directory to which modern versions of Delphi build by default.

     

    Angus

     


  3. If you undefine {$DEFINE OpenSSL_Resource_Files}, ICS will look in the ICS-OpenSSL directory for the DLLs, so how does make you in control? 

     

    If you want to load the DLLs from your own specified location, like the application directory, you need to add extra code, as has always been the case with ICS, but you'll need to change other defines as well since OpenSSL is now loaded by default before any code is run.  This is explained in depth in readme9, and other places. 

     

    Angus

     


  4. No, ICS will never contain an openssl-x64.exe file, since ICS does not use openssl.exe. 

     

    Our OpenSSL zip distributions are separate for Win32 and Win64, so it is up to end users to do something if they want to combine them. 

     

    SVN and the overnight zip do now correctly have the Win32 version of openssl.exe, the Win64 version was an error.

     

    Angus

     


  5. Setting up MTS/ATS for Windows is not trivial, Azure command line interface, new signing tool, Azure signing DLL, .net8 runtime, environmental variables, Azure commands, etc. 

     

    Not helped by the Microsoft web site code and Json examples all using non-breaking spaces (xA0) which have to be replaced by real spaces to do anything useful.

     

    Once installed, it attempts to sign my program, but fails with OAuth2 login using a browser, and with incorrect secrets, so many to choose from in Azure. 

     

    So the documentation needs much clearer information of how Azure authentication should be set up for Windows apps.

     

    Angus

     

     

     

     


  6. In the progress of getting this working, setting anything up in Azure is horrible, I've got OAuth2 stuff, now waiting for company identity validation.  I've had MSDN and partner accounts for 30 years, used to get a box of CDs each quarter before the internet. 

     

    Worth mentioning that if you have a partner MAPS account and pay annually (UK £350) to get all the MS OS and apps, you get $100 of Azure credit each month, which I assume can be used for code signing.

     

    Two minutes later, validation pass.

     

    Angus

     


  7. I'll be happy not needing to deal with Digicert, Sectigo and co, particularly with their massive price increases in recent years.  Let's Encrypt stopped most of their web certificate business.

     

    Microsoft does have a history of looking after developers, for many years there was a web page that allowed buying heavily discounted certificates from the major vendors at the time, it disappeared a few years ago. 

     

    Angus

     


  8. Thanks for all the useful comments, I'll try it myself when I have time later in the week.  

     

    Got another eight months left before my code signing certificate expires, but looks like I can avoid dongle hell.  I've had an Azure account for years, although perhaps not the correct type of account. 

     

    Angus

     


  9. Generally, in the progress event, you check the LogLevel so that LoglevelProg is displayed, not logged every two seconds during the download, as you did in your example above, although does not really matter for small files. 

     

    The component reports the HTTP reported size at the end and does not check the actual file, the snippet sample checks the real size after download.

     

    Angus

     


  10. I just tested the 'HTTP Rest Download' function in the snippets sample, that downloads a 300M file from my server, same code as yours, I get a 300M file.  How are you reporting the size downloaded?

     

    Beware the V9.1 snippets sample won't download from my server any longer, I added server authentication to test something else, and you'll need a new snippets from SVN or the overnight zip that adds authentication as well.

     

    Angus

     


  11. Beware TWinCertificate is only declared in Delphi 12, perhaps ImageHlp as well. 

     

    But I'll look at those functions to allow verifying the signing chain using OpenSSL instead of the slow capicom.dll COM object used by my component at the moment, but not looked at the component for several years. 

     

    Angus

     


  12. This Win64 exception was due to using Free on a stream that was already closed, instead of NilAndFree which checks first, and is used elsewhere in the same function. 

     

    Not sure why Win32 hides the bug, but Win64 does not, this was within finally/end.

     

    Not in SVN yet, and the V9.1 HTTP snippet is now broken because last week I added authentication to the web server directory it uses to test something else, and forget snippets uses that directory.

     

    Angus

     

     

    • Thanks 1

  13. The sample OverbyteIcsIpStmLogTst is the proper test bed for the TIcsIpStrmLog component.  For a successful remote connection, the events triggered are:

     

    11:55:09 C[0] State: Starting
    11:55:09 C[0] TCP/Client Opening Connection to [2a00:1940:0:c::128]:80
    11:55:09 C[0] TCP/Client Connected OK
    11:55:09 C[0] State: OK

    (manually stopped)
    11:55:24 C[0] State: Stopping
    11:55:24 C[0] TCP/Client Disconnected
    11:55:24 C[0] State: None

     

    But for an unsuccessful connection it normally keeps trying to reconnect to the remote IP, so there is no immediate state change:


    11:50:56 C[0] State: Starting
    11:50:56 C[0] TCP/Client Opening Connection to [2a00:1940:0:c::128]:5000
    11:51:17 C[0] TCP/Client Failed Connection - Connection timed out (#10060) - Retrying in 10 secs
    11:51:27 C[0] TCP/Client Opening Connection to [2a00:1940:0:c::128]:5000

     

    This is one of the 'features' of the component, if the client connection fails or drops it keeps trying to restore the connection, although that is exactly what you don't want! 

     

    With RetryAttempts set to -1, the events called are:

     

    12:06:45 C[0] State: Starting
    12:06:45 C[0] TCP/Client Opening Connection to [2a00:1940:0:c::128]:6666
    12:07:06 C[0] State: Stopping
    12:07:06 C[0] State: None
    12:07:06 C[0] TCP/Client Failed Connection - Connection timed out (#10060)
    12:07:06 C[0] TCP/Client Disconnected

     

    So you need to check Stopping and/or None for failure, there is no specific State: Failed event, unless you watch the literals for timeout out. 

     

    Angus

     

    • Like 1

  14. Most ICS functions are async, not blocking, you missed IpLogClient.onLogProgEvent := onCliLogProgEvent; from snippets, and in the event you check IpLogClient.States[0] for logstateOK or something else if failed. 

     

    As is often discussed here, it is rarely necessary or useful to use ICS components in a thread, but if so you can not use application.processmessages  since that is the main thread, you have to create the component within the thread Execute method, set the MultiThreaded property to true, and call the component ProcessMessages method instead.

     

    Angus

     

    • Like 1

  15. Quote

    Why TIcsIpStrmLog and not TSslWSocket directly?

    The magic word was simplest, less code, fewer errors.

    Quote

    by using a non-blocking socket with select() or (e)poll() for the timeout.

    Windows supports none blocking DNS lookups and sockets by using a thread, what is the API to stop those threads early?

     

    Angus

     

×