Jump to content

Angus Robertson

Members
  • Content Count

    1691
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by Angus Robertson

  1. Angus Robertson

    Will getit work for C++ Builder

    I attempt to keep the C++ packages up to date with each new release of ICS and Delphi, but can not test them, and get virtually no feedback from C++ users. The GetIt installers are done by Embarcadero, I just provide a zip with the Delphi and C++ packages, and again don't test C++. Never used CodeGuard, no idea how it interferes with ICS. I've been using TSslHttpCli in Windows services on my public servers for 15 years, it just works. Angus
  2. Angus Robertson

    How to get the actual UTC time??

    Any API that requests system time is dependent on the computer clock being set correctly and with the correct time zone. Windows will then use NTP to keep it correct. Relying on NTP time is dangerous since the internet is not reliable, nor are NTP servers, nor DNS to reach them. Relying on a single NTL server is also dangerous, unless it's hosted across distributed hosts, like time.google.com or time.cloudflare.com, nist.gov has at least 15 different host names, don't know if they are distributed. Angus
  3. Angus Robertson

    How to get the actual UTC time??

    GetSystemTime function (sysinfoapi.h) Retrieves the current system date and time in Coordinated Universal Time (UTC) format. To retrieve the current system date and time in local time, use the GetLocalTime function. https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtime Angus
  4. Angus Robertson

    How to get the actual UTC time??

    function IcsGetUTCTime: TDateTime; var SystemTime: TSystemTime; begin GetSystemTime(SystemTime); with SystemTime do begin Result := EncodeTime (wHour, wMinute, wSecond, wMilliSeconds) + EncodeDate (wYear, wMonth, wDay); end ; end; Angus
  5. TSslWSocketServer has a property SslCliCertMethod which determines whether a client certificate is required or optional, you check the certificate in the OnSslHandshakeDone event and close the connection if invalid, it is documented on the wiki page, http://wiki.overbyte.eu/wiki/index.php/TWSocketServer. Note I've not tested this for a while. Angus
  6. Angus Robertson

    Using OverbyteIcsTnOptFrm.dfm

    Those commands are there due to OverbyteIcsTnOptFrm.pas needing the dfm in the same directory as the library is built. But neither unit is used that often, they are the user interface for the TnEmulVT component, a telnet terminal. Angus
  7. Currently ICS only uses the Certxx APIs to extract certificates from the Windows store and to validate certificate chains, I'm just adding bits to put certificates into the store, but won't be done this week. My reading suggests CryptAcquireCertificatePrivateKey is how you get the private key for a certificate you find in the store, but not tried it yet. ICS has classes TX509Base and TX509List which allow certificates and bundles to be created, read and saved in various formats, there is sample OverbyteIcsPemtool that illustrates everything, and another OverbyteIcsX509CertsTst that acquires certificates from Let's Encrypt. including multi-domain wildcards. Sorry, never used THTTPRIO so no idea what it does, but the ICS HTTP client supports client certificates. You can use ICS synchronously, there are methods for that. Angus
  8. Angus Robertson

    Indy & OpenSSL 1.1.1 & TLS 1.3

    Flagged by whom? TLS 1.2 is perfectly good provided you disable a lot of weak ciphers and hashes. Most IIS sites are still only TLS 1.2, Microsoft does not support TLS 1.3 until Windows Server 2022. Angus
  9. I'm just adding import and export for certificates to and from the Windows store, for ICS. PFXImportCertStore and PFXExportCertStoreEx seem to be preferred solution to convert to and from a PFX/PCKS12 blob containing a certificate, private key and intermediates. Beware you won't be able to export from TPMs, only certificates saved with exportable private keys. But since you have PFX and PEM files, not sure why you are using the Windows store. Angus
  10. Angus Robertson

    THttpAppSrv - Add*Handler for PUT and DELETE

    SVN has been updated with a new OverbyteIcsHttpAppServer adding support for PUT and DELETE verbs, also OverbyteIcsDDWebServiceSrv.pas now uses TUrlHandlerRestApi instead of as a virtual page, little simpler. Angus
  11. Result := GetEnumName (TypeInfo (TEnum), Ord (FEnum))); Angus
  12. Angus Robertson

    THttpAppSrv - Add*Handler for PUT and DELETE

    Beware the ICS web server samples include a lot of code for dynamic demonstration pages, which you can mostly remove to give yourself the basis of a commercial web server service listening on multiple IP addresses. ordering SSL certificates and with request logging. However the REST sample page is implemented as a virtual page not a URL handler, other pages are URL handlers. The main issue with the current ICS web server being a single thread, so blocking SQL calls can reduce performance. My experience over 10 years is my SQL calls mostly take 10ms or less, so the performance hit is minimal, it can still support 50 requests a second (but not new SSL connections). The long term ICS wish list has a heavy web server, that will be configurable to allow x connections per thread, down to one if they are effectively blocking. Angus
  13. Angus Robertson

    THttpAppSrv - Add*Handler for PUT and DELETE

    I'll look at adding the missing handlers in the next week or so. You may want to look at a new SSL sample, OverbyteIcsDDWebService.dpr which is very similar to OverbyteIcsSslMultiWebServ.dpr, but designed as a Windows service, although it will also run as a GUI for debugging. It requires DDService service framework to be installed from https://www.magsys.co.uk/delphi/ddservice. asp. It also includes a REST server with simple lookup responses from a SQL database, which optionally requires DISQLite3 to be installed from http://www.yunqa.de. Note this sample in not in the project groups due to these pre-requisites. This sample is part of the next release, in SVN and the overnight zip. It is effectively a working REST server, very similar to a commercial server I've written at https://api.telecom-tariffs.co.uk/ but you need a login to do actual REST requests. Angus
  14. Angus Robertson

    Location change bug with fragment

    The relocation fix is now in SVN. The repository server is working fine, but wiki.overbyte.eu with the overnight zip has been down for two days, probably due to the flooding in Liege, but ICS can also be downloaded from https://www.magsys.co.uk/delphi/magics.asp Angus
  15. Angus Robertson

    Location change bug with fragment

    You were correct, a fragment/anchor/bookmark in the URL should never be sent to the server, it is purely an instruction to the browser on how to display the page. The ICS unit did attempt to remove # during relocation, but relocation has many different paths in the code, and it was not always being done. I've corrected in my master, won't be in SVN for a day or two, but in the latest SVN version add these lines to the function EncodePathOnly: I := Pos('#', OldPath); if I > 1 then Result := Copy (OldPath, 1, I - 1); My issue with the SSL/TLS certificate was me using an old sample application. Angus
  16. Angus Robertson

    Location change bug with fragment

    It would help if your application had better logging, you would then have seen the real error: www.w3.org SSL Handshake Failed - error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed, State: error This only happens if ICS is set to check the certificate chain, which is normal, but means you need to keep the root store up to date to allow verification to work. I updated the ICS root stores last week but not in SVN yet, and the root certificate 'USERTrust RSA Certification Authority' seems to be different to the one the site is using, I'll look into this next week. Angus
  17. Angus Robertson

    Location change bug with fragment

    Neither Firefox nor ICS redirect to w3.org, using the ICS Frame Browser sample: FrameBrowser Get: https://www.htmlvalidator.com/help.php?h=aria-atomic&amp;m=6 [0] > GET /help.php?h=aria-atomic&amp;m=6 HTTP/1.1 [0] < HTTP/1.1 302 Found [0] < Location: help.php?m=2&h=html Redirected to: https://www.htmlvalidator.com/help.php?m=2&h=html [0] > GET /help.php?m=2&h=html HTTP/1.1 [0] < HTTP/1.1 200 OK Angus
  18. Angus Robertson

    Windows 11 and Server 2022 versions

    Just created VMs with Windows 11 and Windows Server 2022 versions to see what the real internal versions are, and it seems still major version 10. Windows 11 has a raw version of 10.0.22000 and DisplayVersion 21H2. Windows Server 2022 preview is a little older and says 10.0.20348 and DisplayVersion 21H2. So it looks like build 20000 and higher are the new versions, not major version 11. Also, for a year or so they seem to have been using DisplayVersion (20H2) from the registry instead of ReleaseID ( last was 2009), and Windows 11 still says 2009. Angus
  19. Angus Robertson

    Delphi compatibility with Windows 11?

    This is an Intel firmware Trusted Platform Module in the PC BIOS, using Intel Platform Trust Technology built into many Intel processors. In my Asus BIOS, I found PCH-FW Configuration, then Enable PTT, not very clear what PTT meant, so I never set it, they should spell out Trust to make it clearer. Now WMI says: Win32_Tpm, instance 1 of 1 IsActivated_InitialValue = True IsEnabled_InitialValue = True IsOwned_InitialValue = True ManufacturerId = 1229870147 ManufacturerIdTxt = INTC ManufacturerVersion = 500.14.0.0 ManufacturerVersionFull20 = 500.14.0.0 ManufacturerVersionInfo = Intel PhysicalPresenceVersionInfo = 1.3 My older Asus PC says ManufacturerIdTxt = IFX which is Infineon Technologies AG who make the chip in most TPM modules. Angus
  20. Angus Robertson

    Delphi compatibility with Windows 11?

    Or use Computer Management, Device Manager, Security devices, and it should say Trusted Platform Module 2.0 with a very old driver. Angus
  21. Angus Robertson

    Delphi compatibility with Windows 11?

    A UEFI BIOS is something you have, or an old fashioned BIOS. TPM is hardware, but sometimes needs to be enabled in the BIOS. I built a new PC six months ago, had an Asus MB choice between five SATA ports and a TPM slot, or six SATA ports, but I needed all six for a lot of flash and spinning rust, with RAID. Unfortunately, TPMs do not seem to come on PCIe cards, only special slots. had one in my old PC. Angus
  22. Angus Robertson

    Delphi compatibility with Windows 11?

    It is possible to patch the Windows 11 installer to skip the TPM check. Has anyone tried Windows Server 2022 yet, does it also require a TPM? Presumably based on W11 rather than W10. Angus
  23. Angus Robertson

    ICS V8.66 announced

    I know Git is much better than SVN, but I would rather spend my limited time improving ICS than learning Git and migrating our systems built around it. Whoever finally takes over as ICS maintainer will need to start again since SVN runs on my hosted servers. Angus
  24. TCustomTimeoutWSocket is only built if BUILTIN_TIMEOUT is defined, although that has been the default for a few years. Server client sockets do descent from that class, and the timeout settings could be set in code when the client is created. But you would then have one ICS thread timer per client, rather than a single timer monitoring all clients as happens with the high level servers. Angus
  25. Angus Robertson

    ICS V8.66 announced

    How would a Git repository be more beneficial than the existing SVN repository? I'm afraid I dislike Git, my past experience of it is very poor, very time consuming to make contributions and I do not have the time to learn any more about it. There are very few contributors to ICS, maybe one external fix a month, easily handled by SVN. Angus
×