-
Content Count
2010 -
Joined
-
Last visited
-
Days Won
36
Everything posted by Angus Robertson
-
Adding (CORS) Headers for simple fileserving THttpServer
Angus Robertson replied to omnibrain's topic in ICS - Internet Component Suite
There are various methods for sending web server responses, SendDocument has a CustomHeaders property where you put complete header lines, while AnswerPage, AnswerStream, AnswerString, etc have a Header property that does the same. You don't need to use an event. Angus -
HTMLViewer - is there a Delphi 11 version?
Angus Robertson replied to RCrandall's topic in Delphi Third-Party
The missing path "\$(Platform)" error in D11.2 effected many other components, it was nothing to do with HTMLViewer specifically, Angus -
How to use a certificate from the Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
ICS attempts to extract a private key from the Windows store, but I don't recall it working on any of my servers or PCs, so untested. So if it works, good, if not, as expected. I don't plan on testing this again since it is not a core ICS function, not needed for any samples. Personally, I would not distribute an application that relies on extracting a private key from the Windows Store, you have to hope that whoever imported it ticked the correct box to allow export, and Microsoft has not changed the rules again. I would tell the customer you need the PFX. to use with OpenSSL. But you easily test if your FSslCertX509 object has a matching key and can be used as a server certificate. If you are using the recommend IcsHosts server properties, the certificate gets checked and reported before the server starts, so you know if it's going to work. Angus -
How to use a certificate from the Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
We are going in circles here, even if you load the certificate into the context a subsequent error will happen since there is no private key with the certificate. The TX509Base and TMsX509List classes can hold a private key, but if you use PemTool to list a store you'll see it reports 'Private key in User Store, Could not export private key - The requested operation is not supported'. Only the Microsoft crypto functions can access the private key store, and OpenSSL does not use them. For your own code, you don't show a definition for lMsX509List nor how you are indexing into the list, but it should be something like FSslCertX509 := MyList{x]. or MyList.Items[x] Angus -
How to use a certificate from the Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
No, the question is why if you already have a PFX file with a private key, you are installing it into the Windows Store in the first place, then reading it again without the private key and expecting it to work as a server certificate. Why not use the PFX directly. The ICS pemtool loads certificates into the windows into the Windows Store correctly, I do it all the time to use Let's Encrypt certificates with IIS. The exception will be an error in your code. Angus -
How to use a certificate from the Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
So you are attempting to use a certificate from the Windows store as a server certificate? How did you set the private key for this certificate. You can not extract private keys from the Windows store? Server certificates are useless without a private key. Private keys are kept by Windows in a different store and linked to certificates, but not stored together. Windows itself provides a means to export certificates with a private key, if allowed, but this is not implemented by ICS, not sure if the APIs allow it. Most certificate have key export blocked to stop them being stolen. Angus -
How to use a certificate from the Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
Can you please explain the purpose of using a certificate from the Windows store? Is this in your client or server application, as a server or client certificate. Is your server or client giving an exception? Angus -
Using System.Zlib instead of OverbyteIcsZLibObj
Angus Robertson replied to EugeneK's topic in ICS - Internet Component Suite
The ZLIB changes to use System.Zlib are now in SVN, considerably simplified so two defines are now only used once each in one unit, making it easier to support. But you do need to use the new OverbyteIcsDefs.inc or edit your own version, see the SVN notes. Angus -
TRESTClient Security Error 12175 following Windows Update
Angus Robertson replied to Andrew Spencer's topic in Network, Cloud and Web
Sorry, yes 21H1 is out of support in two months, 21H2 I guess has another eight months. Angus -
TRESTClient Security Error 12175 following Windows Update
Angus Robertson replied to Andrew Spencer's topic in Network, Cloud and Web
My Windows Server 2019 is version 1809, the long term support version of Windows 10, which Microsoft promises not to break with untested Windows updates. The TLS bug seemed to be 21H2 only, for both Windows 10 and 11, and 10 21H2 is out of support in two months anyway. Angus -
Send a custom error document for 404 Not Found ?
Angus Robertson replied to Incus J's topic in ICS - Internet Component Suite
To send custom error responses you can create overloaded versions of Answer404, etc, in your version of THttpConnection or THttpAppSrvConnection. Angus -
TRESTClient Security Error 12175 following Windows Update
Angus Robertson replied to Andrew Spencer's topic in Network, Cloud and Web
Just done some testing using the D11.2 TRESTClient component on Windows 11 Enterprise 22H2 fully updated, It seems all TLS protocols are still available to the client. I have servers built with the ICS web server component that can report the TLS client hello packet that tells the server what protocols the client can accept. The URL is https://api2.telecom-tariffs.co.uk/serverinfo.htm which returns an information page about the server and client connected, for the TRESTClient with all TLS boxes ticked the Hello starts with: Client Hello: Server Name: api2.telecom-tariffs.co.uk, ALPN: , Versions: TLSv1.2, TLSv1.3, TLSv1.2, TLSv1.1, TLSv1.0, TLSv1.3 Key Share Data which means all four protocols are accepted, ticking just TLS12 and only that protocol appears in the Hello, and works. Windows 11 also connects with TLS/1.3 if requested, without registry patches. However, I may have previously done the patches two years ago when first testing TLS/1.3. I do hack the PC a lot, currently Edge and Windows File Explorer are dead with exceptions. Angus -
TRESTClient Security Error 12175 following Windows Update
Angus Robertson replied to Andrew Spencer's topic in Network, Cloud and Web
It's possible that changing the SSL version tick boxes might require a reboot to be effective, that is certainly the case when you change SSL protocol settings such as ciphers in the registry or using Powershell. Angus -
In theory, you can do this with the ICS JOSE functions like IcsJoseJWKPubKey and IcsJoseJWSComp that are used to implement the ACME protocol for Let's Encyrpt certificate ordering, which work with the ICS REST component. But often these JWT implementations have little tweaks or special features that might mean minor changes to these functions. ICS may be installed from GetIt or http://wiki.overbyte.eu/wiki/index.php/ICS_Download. Angus
-
Search thumbprint in Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
You probably have not initialised OpenSSL to load the DLLs with OverbyteIcsWSocket.LoadSsl Angus -
Not sure if it's just my PC, but updating to Windows 11 22H2 last week stopped .BAT files running due to the file association being removed, it seems Windows now prefers them to be called .CMD instead. Most other file associations disappeared as well, but that is just Microsoft wanting us to use it's own apps and not better ones. Easy enough to rename my common batch files, but GetIt often builds libraries using BAT files, so had to restore the file association with a little REG file. Windows Registry Editor Version 5.00 [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat] [-HKEY_CURRENT_USER\Software\Classes\.bat] [-HKEY_CURRENT_USER\SOFTWARE\Classes\batfile] [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bat] @="batfile" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\open\command] @="\"%1\" %*" Windows Explorer also now crashes with a .NET run time error, which is pretty sad, fortunately I mainly use the Delphi UltraExplorer instead. Possible the Explorer crash is due to third party software like Open Shell Menu. Angus
-
Windows 11 22H2 lost batch file association
Angus Robertson replied to Angus Robertson's topic in Delphi IDE and APIs
But not in the GetIt scripts, and perhaps many other installers, which is why I brought it up. Angus -
Using System.Zlib instead of OverbyteIcsZLibObj
Angus Robertson replied to EugeneK's topic in ICS - Internet Component Suite
Busy finishing off other things, but the System.Zlib implentation will be the most painless and backward compatible solution possible, as are most ICS changes, don't like breaking things. Angus -
Delphi 11.2 seems to have new IDE bookmarks behaviour, which I understand is an IDE Bookmarks addin from Parnassus. In the IDE I have dozens of tabs open with different units, with bookmarks in a few of those units. If I right click to show the Bookmarks menu it lists bookmarks in the current unit, but if I select one the editor cursor jumps to a random bookmark in a different unit instead of the current unit. Just discovered there is a new docktable Bookmarks window that seems to work for the current unit, but the right click menu bookmarks I've used for 20 years are still useless. Angus
-
The Bookmarks docking window is not in Delphi 2007, so new some time since then, I've never looked for it before since the old way of using bookmarks worked perfectly, until Delphi 11.2. There are probably numerous other IDE features I've missed as well! I do like conditional lines being (sometimes) greyed in 11.2, very useful when working on projects with vast amounts of conditional code. Did not need to search for that, just worked. Angus
-
Search thumbprint in Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
Yes, this is illustrated in the PemTool sample, on the Certificate Tools tab, select a Windows store and click Display Cert Store. This fills a TMsX509List using the LoadFromStore method, the sample displays the main information for all certificates found, but you can use the Find method to get the certificate with a specific SHA1 digest. If you want the SHA256 digest you'll have to loop checking each. Angus -
No, the Win64 path issue is not fixed by the patch, you have to manually patch the registry or change the library path, just done it, so ICS packages can again be built. Angus
-
New security requirements for code signing, disruptive ?
Angus Robertson replied to A.M. Hoornweg's topic in General Help
That concept I can live with for a local dongle, the major problem I have is with shipping physical dongles around the world each year to be updated. customs do not like USB keys. Angus -
New security requirements for code signing, disruptive ?
Angus Robertson replied to A.M. Hoornweg's topic in General Help
Yubico has a SDK for the ubiHSM 2 FIPS dongle which can be used with older OpenSSL releases using engines, then Osslsigncode updates the PE file authenticode signature. TPM2 might be easier, not sure if Yubico supports it. Angus -
New security requirements for code signing, disruptive ?
Angus Robertson replied to A.M. Hoornweg's topic in General Help
I signed the OpenSSL binaries with a Certum dongle for a while, that prompted for a password for each file which was a pain, then Certum told us the dongle was obsolete and we'd have to buy a new one, so gave up and now using my Comodo/Sectigo certificate. One possible solution is to use OpenSSL to sign Windows PE files, there is project Osslsigncode intended to sign on Linux but can be built for Windows. Another project has a TPM2 provider for OpenSSL that should be able to read keys from dongles, although not checked if the Yubikey is a TPM2. Not a trivial project, but might be a good solution. Angus