-
Content Count
2047 -
Joined
-
Last visited
-
Days Won
38
Everything posted by Angus Robertson
-
There is also the risk when using non-standard protocol extensions that firewalls, proxies, load balances, etc, may reject or corrupt the requests. If an API needs to delete a massive number of files, it should use an HTTP POST request with the Json including a delete command, not the HTTP DELETE request with content. But I will look at adding this to the ICS client and server, so we can at least test what happens when content is sent with GET and DELETE. Angus
-
Poor mans HA
Angus Robertson replied to bk31415's topic in Algorithms, Data Structures and Class Design
Please make sure you are using MQTT from SVN or the overnight zip, I did a major rewrite a couple of months ago that is not yet released. Coming back to your original problem, the best solution will be a new wrapper component around the ICS MQTT client, that handles reconnection if the connection drops, including using a list of IP addresses for multiple servers. This will avoid applications needing to handle all the reconnection stuff, which is tedious. I'll put it on my list, but it may not make the next release, which is already overdue. The TIcsIpStrmLog client component already does reconnections, just need to take those properties and methods. Angus -
I said that TRestParams can not currently create an array of Json objects, at least without nesting multiple components, but it may in the future, Angus
-
Poor mans HA
Angus Robertson replied to bk31415's topic in Algorithms, Data Structures and Class Design
Not sure how quickly your network will recognize that an IP address has moved between devices, that is something that does not happen very often. Each client will need to refresh its ARP cache table to find the MAC of the new PC. WMI can be used to change IP addresses, ICS has a free WMI component and sample that sets IP addresses and gateway. A better solution would be for the clients to know about each server, and use the secondary if the primary fails to respond. Angus -
You just build a Json string with your parameters, you can use some helpers from TRestParams.GetParamStream like IcsEscapeJson if your content needs such processing. Then pass the string as RawParams in RestRequest(), the component then builds a stream for you. But this will fail for DELETE as discussed above. Can you please check the API server really is expecting content, do you get a 204 error, does the API documentation actually say content is needed for DELETE? I'm not going to update the component unless I can test it and know the change is really needed. Angus
-
Anything that crashes the ICS web server is something that should be fixed, if you are sure GET with body is fatal, I'll put it on my list to test and try and fix. I get thousands of hacking attempts on my public server daily, even have a dynamic blacklist to block repeats accesses, currently 4,600 IPs blocked for the last thee days. Angus
-
I'm not aware that the DELETE request is allowed to submit data as a body, this is not mentioned at: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/DELETE Which is why PContBodyJson is ignored. If a body is allowed for DELETE, ICS will need to be updated TRestParams does have an array method, RPTypeArray, used by AddItemAR(const aName: String; aValue: TStrings), but there is currently no way to create an array of objects in the manner you require, sorry I simply never anticipated it when designing the component, there are simply too many ways to build Json. I'll put it on my list, but it may take a while. Meanwhile, you could build the Json with SuperObject or manually. Angus
-
9.4 on C++ Builder 12.3
Angus Robertson replied to w0wbagger's topic in ICS - Internet Component Suite
I've removed the unwanted DCR and -k, did not show up because Build Groups stops on the first error, so never got to build all the different versions. I fixed the MQTT warning yesterday and have just done the AnsiString warnings, so C++ Win32 now builds without any warnings or errors. Win64 fails completely because dcc64.exe seems to have disappeared with D12.3, think they want us to use Win64 Modern only now, but I get the same error with Win64 Modern. Sorry, no time to mess any more now. Can not upload anything to SVN until I've finished some testing, early next week. Angus -
9.4 on C++ Builder 12.3
Angus Robertson replied to w0wbagger's topic in ICS - Internet Component Suite
I've just built V9.5 for Win32 using C++12.3 without any errors, just a couple of deprecated warnings. As I did before the V9.4 release. I have removed the -r argument. So maybe you had old versions of these files somewhere, I'll be updating SVN in the next few days, and I'll make sure my work C++ library files are in the SVN directory. Angus -
9.4 on C++ Builder 12.3
Angus Robertson replied to w0wbagger's topic in ICS - Internet Component Suite
Before I comment any further, can you please confirm you are using ICS from the overnight zip or icsv94.zip or SVN? ICSCommonCBNewDesign.cbproj should be dated February or March 2025, and contains the XML line: <BCC_UserSuppliedOptions> -r</BCC_UserSuppliedOptions> I don't see any -k. So it would appear you are working with some other version of ICS. Angus -
The old OverbyteIcsHttpPost sample is for use with THttpCli. If you are using TSslHttpRest, the OverbyteIcsHttpRestTst sample includes several ways of uploading data. POST is simply a command, servers accept uploads in many different ways, since they usually need to know the file name and other information. Angus
-
9.4 on C++ Builder 12.3
Angus Robertson replied to w0wbagger's topic in ICS - Internet Component Suite
Thanks, I'll remove the -k flag. I was able to build V9,4 for D12.3 OK, but Embarcadero was not, which is why it's not in GetIt. For C++ Win64 old, I get four unresolved external errors I don't understand, and Win64 Modern fails completely because the compiler does not export the correct symbol files, reported last year but not fixed in D12.3, yet. Angus -
ICS SmtpClient Mime Header Encode
Angus Robertson replied to alf.krause's topic in ICS - Internet Component Suite
So you are saying that: Smtp.FromName := HdrEncodeInLineEx((MyStr, SpecialsRFC822, 'Q', CP_UTF8, 72, false); does not encode the name? It does seem the email samples don't actually use inline encoding, and perhaps it should be handled by the SMPT component, since we all use unicode compilers nowadays and expect strings to be converted properly. If I can make that work in a backward compatible way, I'll look at adding it to ICS. Angus -
TCP Server + Client + Threaded and Bytes
Angus Robertson replied to AJ_Oldendorf's topic in ICS - Internet Component Suite
LineMode/LineEnd is normally only used for ASCII protocols with limited line lengths, ie HTTP/SMTP etc, The DataAvailable event should only be triggered by LineEnd, but might also be if the connection is closed, or maybe not. That was why I suggested the TIcsIpStrmLog componemt which has more options to avoid data being lost, but unfortunately not long LineEnds. But I'd still use it for your clients, unless the server also sends long LineEnds. Angus -
TCP Server + Client + Threaded and Bytes
Angus Robertson replied to AJ_Oldendorf's topic in ICS - Internet Component Suite
You did not add LineEnd, so it never finds the end of your records. Angus -
TCP Server + Client + Threaded and Bytes
Angus Robertson replied to AJ_Oldendorf's topic in ICS - Internet Component Suite
The TIcsIpStrmLog component can be configured for TCP or UDP. It can do file transfers, but has SendLogLine (const Line: TBytes) which is exactly what you requested. For clients, the component handles connection retries if/when the connection drops. Reading your message again, the record end of eight bytes is not handled, only a single symbol or CRLF, but you could easily adapt the component receive loop to check for a longer end of record. OverbyteIcsThrdSrv is a very old server sample and has not been tested for many years. Try OverbyteIcsSimpleSslServer, inSslWSocketServer1ClientConnect set a long LimieLimit and LineEnd to your six bytes. Ignore the SSL stuff. Angus -
TCP Server + Client + Threaded and Bytes
Angus Robertson replied to AJ_Oldendorf's topic in ICS - Internet Component Suite
ICS sends binary data at the lowest level, it has methods to send strings and TBytes to make life easier for the developer. You need to be more cautious receive, in case of disconnection when your packet end is lost. I'd recommended building the OverbyteIcsIpStmLogTst sample, it uses the TIcsIpStrmLog component that is designed for simple data transfer like yours, it can be configured as a client or server to send and receive packets, the sample should interwork with your existing applications. TIcsIpStrmLog saves a lot of code over using the lower level components, should be working in a day. Angus -
ICS SmtpClient Mime Header Encode
Angus Robertson replied to alf.krause's topic in ICS - Internet Component Suite
Email headers are inline MIME encoded, using HdrEncodeInLine in the OverbyteIcsMimeUtils unit, there are a lot of options for character sets, Q or B encoding, and how to wrap or fold long lines. Look at the OverbyteIcsMimeDemo sample, this illustrates how to use HdrEncodeInLine and other similar MIME encoding and decoding functions. Angus -
Subscribe to a topic with TIcsMQTTClient
Angus Robertson replied to Alberto Fornés's topic in ICS - Internet Component Suite
The onClientMsg event is only triggered for published messages, Sorry, don't know off hand which event is triggered to acknowledge subscribe, you'll need to check the source code. Angus -
Subscribe to a topic with TIcsMQTTClient
Angus Robertson replied to Alberto Fornés's topic in ICS - Internet Component Suite
My Mosquitto log shows exactly that. 2025-03-21T12:51:02: Received SUBSCRIBE from CID64860 2025-03-21T12:51:02: update/memo (QoS 2) 2025-03-21T12:51:02: Sending SUBACK to CID64860 Angus -
Subscribe to a topic with TIcsMQTTClient
Angus Robertson replied to Alberto Fornés's topic in ICS - Internet Component Suite
First place to look would be the Mosquitto log file, maybe subscribe failed for some reason. I did test the latest version against local and remote Mosquitto servers, but my knowledge of the MQTT protocol is almost nil so I don't know what to expect when I click the various test buttons. Angus -
ICS - XX: The XX field is required
Angus Robertson replied to Rolphy Reyes's topic in ICS - Internet Component Suite
ICS is simply reporting a REST API error that says your XML contains an error. So you need to correct your XML. Or maybe you are using the wrong API? Angus -
https://www.iana.org/assignments/jose/jose.xhtml and https://www.iana.org/assignments/jwt/jwt.xhtml are a good start to JOSE and JWT and the RFCs that explain the standards for the numerous possible names. Angus
-
SSL/TLS certificate maximum issue period of 47 days is coming in 2029
Angus Robertson replied to Angus Robertson's topic in ICS - Internet Component Suite
https://www.theregister.com/2025/04/14/ssl_tls_certificates/ https://www.feistyduck.com/newsletter/issue_124_certificate_lifetimes_to_shrink_to_just_forty_seven_days and numerous other sites that reported the same April vote, although https://cabforum.org/ has not yet been updated with the minutes of the meeting, or at least I can not find them. If you are interested in SSL/TLS, subscribe to the Feisty Duck monthly newsletter, it collects all the news. Angus -
SSL/TLS certificate maximum issue period of 47 days is coming in 2029
Angus Robertson posted a topic in ICS - Internet Component Suite
Currently, SSL/TLS certificates may be issued for a maximum period of 398 days, before renewal is required. The CA/Browser Forum recently voted to reduce this life span period in steps over the next four years. From 15th March 2026, life span is reduced to 200 days. From 15th March 2027, life span is reduced to 100 days. From 15th March 2029, life span is reduced to 47 days, but only 10 days for domain control validated certificates, such as most free certificates. These reduced life times reduce the effort needed to block compromised certificates, but also make manually updating server certificates more onerous. The Automatic Certificate Management Environment (ACME) developed by Let's Encrypt and used by many web servers, is now supported by other certificate vendors to issue free and commercial certificates automatically, and will hopefully be fully integrated with all major web servers by 2029. Let's Encrypt is adding a certificate profile to the ordering process, allowing alternate certificate types to be ordered, including six day life certificates later this year. It has also added a ACME command to get recommended renewal information, which is currently 30 days before a 90 day certificate expires. Applications are recommended to check renewal information regularly, currently every six hours, to check if certificates have been revoked. This will be important this summer when Let's Encrypt closes down the Online Certificate Status Protocol currently used to check if certificates are validly issued. A new version of the ICS TSslX509Certs component is currently being tested with these new ACME features, it will also attempt to support ordering certificates from Bypass, ZeroSSL, Google, DigiCert and ssl.com, although these most of these need accounts to be opened at the issuer before the ACME protocol can be used, so testing will not be quick and not all may be available initially. The main difference from Let's Encrypt is external accounting fields to link to the supplier's account, instead of just a public key. Minor changes to IcsHosts are needed for the ICS web server to handle certificate profiles and alternate suppliers, and to regularly update renewal information. These changes are already done in the OverbyteIcsX509CertsTst sample that is used to create ACME accounts and place certificate orders, that can be validated by an internal web server, external web servers such as Windows IIS and Windows Apache, and by Windows DNS server for wild card certificates. The sample supports multiple accounts for different suppliers, listing the status of all orders for those suppliers, and allowing ordering and renewals with a few clicks. I'll update this topic when the ICS web server is updated, hopefully within a week or two, meanwhile could anyone that has looked at alternate ACME suppliers let me know, to help with testing. Angus