Jump to content

Angus Robertson

Members
  • Content Count

    1702
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by Angus Robertson

  1. Thanks, I'll look at this when I get back to ICS next week. Note, there is an ICS forum for future support, but you don't need to repost this topic. Angus
  2. Angus Robertson

    Call for Delphi 12 Support in OpenSource projects.

    It is no secret that many or most components developers are beta testers under NDA, how else are all their components ready for each new release, or in the olde days on the component companion CD included with the final release. This benefits everyone involved, because new versions of Delphi can be used for old projects immediately, rather than waiting weeks for developers to buy the new version, etc. What has changed in recent years is beta testing being offered openly for paying customers, rather than by invitation only, and blogging about the next release, so it is now all more obvious. Angus
  3. I assume you mean the files OverbyteIcsDXeRun.dpr and OverbyteIcsDXeRun.dproj? SHDocVW is not in either of those files so your compiler must have added it. TWebBrowse did keep changing in early versions of Delphi, ICS has several painful conditionals to try and make it work. You can try removing OverbyteIcsOAuthFormVcl, and refeences to it, that might help. Angus
  4. Angus Robertson

    Call for Delphi 12 Support in OpenSource projects.

    Component libraries can be published that have been tested on beta versions, provided they don't reveal any features of the beta or use any new features. The latest ICS v9 release has packages for Delphi 12, but did not need any changes for D12 other than VER360. Several other libraries are also available from GetIt for the beta. Angus
  5. Angus Robertson

    How to validate the public key

    The X509PublicKey property returns a PEVP_PKEY pointer which can be passed for processing to numerous OpenSSL functions, PEM_write_bio_PUBKEY might do what you need, it is used in the PublicKeySaveToText method, but that needs a private key which you don't have. PEM_write_bio_PUBKEY returns base64 ASCII text, the same as you'd find in a PEM file for a public or private key, which is probably what you have already, it probably has the top and tail headers... Angus
  6. Angus Robertson

    How to validate the public key

    ICS exposes the two hashes for the certificate, which are small and easy to check, but this would only work if there is only a single self signed certificate on the network, if there are more than one all signed by the same private key, like a CA, then checking the public key is the only solution. But no-one else has ever needed it. It is only a couple of lines of code using OpenSSL functions, but not this week. Angus
  7. Angus Robertson

    How to validate the public key

    Sorry, no ICS applications need to use or display a raw public key, so there are no methods available to get it as a string. The TX509Base property X509PublicKey returns a pointer to the internal OpenSSL key, but there are no ICS functions to convert this to a string. There are some Jose functions for JSON Web Keys but these need private keys, not public. You can see the use of GetPKeyRawText in the OverbyteIcsPemtool sample, it prints all fields from a certificate, including the public key in hex, but you would have to parse the result to get the hex only. As I said before, applications normally check certificates, not keys. Angus
  8. Angus Robertson

    How to validate the public key

    Checking the public key is exactly how chain verification works. Your self signed certificates should really be signed by your own certificate authority, or ideally an intermediate issued by your own CA. You distribute the CA certificate to your PCs and install it in the Windows and/or PEM store, and all normal certificate chain validation just works, for any application. The OverbyteIcsX509CertsTst sample will create certificates signed by your own CA, or intermediate, I use them for testing on my LAN. If you want to check the server certificate chain yourself, use the OnSslHandshakeDone event. Angus
  9. Angus Robertson

    How to validate the public key

    The OverbyteIcsHttpRestTst sample illustrates SSL/TLS certificate validation, if that is what you mean by key data. You don't have to write code or make decisions, it's all handled automatically by ICS, if you set property CertVerMethod to CertVerBundle or CertVerWinStore. ICS has built in root bundles for certificate validation. Property SslReportChain will report the chain for your log, while SslRevocation will cause an OCSP server to be checked as well. Angus
  10. The comment you quote from the source code is from four years ago, and relates to code contributed and tested by an ICS user OAS. I can not test it since I don't have an NT domain. I can only suggest you search that unit and OverbyteIcsSspi and OverbyteIcsNtlSSp for comments by OAS who made the changes. Angus
  11. If I interpret your short hand correctly, you now have one global SslContext and a second one in the thread. Unless you actually initialise the global SslContext or attach it to a component and make an SSL request, it will not load the OpenSSL DLLs, so your wasteful problem of loading and unloading the DLLs several times a minute will remain. Please read my previous messages where I have explained how to do this properly, I'm not going to keep repeating myself. Angus
  12. Angus Robertson

    ICS 8.70 VCLCB110 64 bits compile error

    There would only have been C++ fixes if someone else found a problem and told me, I don't write or test C++. You should try ICS v9 which is released now and report any issues, ideally with fixes. Angus
  13. The usual way to ensure OpenSSL is only loaded once is to drop an SslContext on the form, or create it once when the program starts. Ideally you initialise it once as well, since that is when the DLLs are loaded, and check to see if the DLLs are actually available to report errors before requests start. The high level components and servers have multiple SslContexts so in that case you call OverbyteIcsWSocket.LoadSsl when the form is created, and OverbyteIcsWSocket.UnLoadSsl; when it's destroyed, as illustrated in numerous samples. You normally set several global variables before calling LoadSsl depending on whether you want old or new OpenSSL versions to be loaded, or from a specific directory, whether you need the legacy DLL, or checking the code signing signature for malware, again in all those samples. Angus
  14. I never said MultiThreaded would solve your problem, I said it was a mis-use of ICS for threads not to use it, it might work in simple cases, but not in most applications. I've already answered most of your other questions with previous comments. ICS how no knowledge of threads. It does reference count loading OpenSSL, but that only works if you free components correctly, so OpenSSL also gets unloaded correctly. Clue: what happens with errors when there is a large amount of code in a try/finally/end, and when you don't close connections first. Angus
  15. Angus Robertson

    IOCP

    IOCP may have some benefits with threaded applications, but those are very rare with ICS. I did some FTP testing a few years ago, ICS was opening over 100 non-SSL connections each second, slower with SSL due to all the negotiation that goes on and IOCP would be irrelevant there. I thought IOCP with TCP was mainly for speeding up transmission, sending larger blocks or files or something. But ICS is quite fast already, I transfer files using ICS FTP between my two public hosted servers in different data centres each night, and file transfer is usually 300 to 400 Mbit/s, less than the gig ethernet port speed, but respectable for the public internet, via routers and firewalls. Angus
  16. Angus Robertson

    IOCP

    Why would you need IOCP with ICS? Angus
  17. Angus Robertson

    ICS V9.0 announced

    Surely those headers are sent with the WebSocket Upgrade request? Why send them again perhaps each second on the same TCP channel, what would the server do with them? Angus
  18. Angus Robertson

    ICS V9.0 announced

    I guess the point is the WebSockets protocol is supposed to be lightweight, and not cluttered with unnecessary headers. Why are you not sending the header information as WebSocket data packets. A configurable option would be needed to bypass that clean-up code. I'll put it on the list, but taking a break from ICS for a couple of weeks. Angus
  19. Angus Robertson

    Current alternatives for SMTP with TLS 1.3

    ICS has various components for SMTP mail, all with the latest SSL/TLS., free from https://wiki.overbyte.eu/wiki/index.php/ICS_Download Look at the OverbyteIcsMailQuTst sample which can now be downloaded pre-built. Angus
  20. Full release notes for V9.0 will follow next week, meanwhile these are the main changes: New samples Samples/Delphi/SslInternet/OverbyteIcsSnippets.dpr - Small samples of codes for FTP, HTTP, sockets and email. Samples/Delphi/OtherDemos/OverbyteIcsNetMon.dpr - Internet Packet Monitoring Components, display packets and traffic using Npcap and raw sockets. Samples/Delphi/OtherDemos/OverbyteIcsNetTools.dpr - Network Tools Demo, uses all the main IP Helper functions, also TTIcsNeighbDevices, TIcsDomainNameCache, IcsDnsQueuy, TDnsQueryHttps, TIcsWhoisCli, TIcsIpChanges, TPing and TPingThread. Samples/Delphi/PlatformDemos/IcsHttpRestTstFmx.dproj - FMX HTTPS REST and OAuth, Send SMS and DNS over HTTPS functions demo. Samples/Delphi/PlatformDemos/IcsSslMultiWebServ.dproj - FMX Advanced multi host web server demo. Samples/Delphi/SslInternet/OverbyteIcsMQTTst.dpr - MQ Telemetry Transport message queuing service. Note this sample needs the VirtualTree component to be installed. Major sample updates for new components Samples/Delphi/SslInternet/OverbyteIcsHttpRestTst1.dpr - Uses TSslWebSocketCli for WebSocket Client, New embedded TOAuthLoginForm window using TOAuthBrowser for OAuth2 logins. Select client SSL certificate from the Windows Certificate Store. Samples/Delphi/SslInternet/OverbyteIcsSslMultiWebServ.dpr, OverbyteIcsDDWebService.dpr - Uses THttpWSSrvConn for WebSocket Server. IcsHosts can use server SSL certificate from the Windows Certificate Store. IcsHosts can now request a SSL certificate from the remote client. WebSocket server support. Uses TIcsDomainNameCache for multiple reverse DNS lookups. Samples/Delphi/SslInternet/OverbyteIcsPemTool.dpr - Can now export an SSL certificate from the Windows Certificate Store with its private key. Samples/delphi/OtherDemos/OverbyteIcsBatchDnsLookup.dpr - Uses TIcsDomainNameCache for multiple lookups. Samples/Delphi/SslInternet/OverbyteIcsSslMailSnd.dpr, OverbyteIcsSslMailRcv.dpr, OverbyteIcsMailQuTst.dpr - New embedded TOAuthLoginForm window using TOAuthBrowser for OAuth2 logins. Samples/delphi/OtherDemos/OverbyteIcsNsLookup.dpr - Uses single or multiple DNS servers, including built-in list of public servers, also sync requests. New Components TIcsDomainNameCache and TIcsDomNameCacheHttps - Cache forward and reverse DNS lookup requests, using several methods. TIcsMonSocket - Internet monitoring using raw sockets. TIcsMonPcap - Internet monitoring using Npcap NDIS driver. TIcsIpChanges - Monitors IP address changes dynamically. TIcsNeighbDevices - Builds historic LAN MAC device and IPv4 and IPv6 address table using ARP, neighbourhood and IP range scanning with reverse host lookup. TOAuthBrowser - OAuth authentication browser window VCL/FMX form. TSslWebSocketCli - WebSocket client protocol. TIcsMQTTServer and TIcsMQTTClient - MQ Telemetry Transport message queuing service, client and server. Major Component Upgrades TDnsQuery - Add synchronous methods and more response properties. Check multiple DNS server hosts including public DNS lists. TSslWSocketServer - IcsHosts can use server SSL certificate from the Windows Certificate Store. IcsHosts can now request a SSL certificate from the remote client. TIcsFtpMulti - Send NOOP command periodically during multi hour transfers so connections are not closed accidentally. New classes and Functions THttpWSSrvConn - WebSocket server protocol. Internet Helper Functions - Unit OverbyteIcsIpHlpApi.pas includes IpHlpConnsTable, IpHlpAdaptersInfo, IpHlpAdaptersAddr, IpHlpIpAddrTable, IpHlpIpNeighbTable, IpHlpIPForwardTable, IpHlpIpPathTable, IpHlpGetDnsServers, IpHlpIfTable2, IpHlpIPStatistics, IpHlpUDPStatistics and many other functions. TIcsMonFilterClass - Filter network traffic on protocols or IP addresses. TIcsTrafficClass - Maintains network traffic statistics by protocols and IP addresses. Angus
  21. Angus Robertson

    ICS V9.0 new components and samples

    Thanks, fixed. Angus
  22. Angus Robertson

    New Code Signing Certificate Recommendations

    I bought a YubiKey 5 NFC recently to test, not spent much time with it yet, the documentation and tools are clear as mud, not managed to install an SSL certificate on it yet... Angus
  23. Angus Robertson

    New Code Signing Certificate Recommendations

    A little research showed Digicert was only supporting Safenet dongles. But at least the concept of allowing the end user to load the certificate into the dongle rather than shipping it removes that major obstacles for users outside major countries. Also surprised to find K-Software has updated it's web site for the first time in years, thought it was moribund, ignoring emails, etc. But prices massively higher, $313 for one year. I paid $188 for three years which is now $657 for the same thing, some massive profiteering going on here. Angus
  24. Angus Robertson

    New Code Signing Certificate Recommendations

    Looking at the Digicert site, they offer: My own qualified hardware token - use the Code Signing certificate provisioning application to install your Code Signing certificate on your token. 'Qualified' might be a weasel word... Also: DigiCert KeyLocker cloud HSM (USD $90.00 / year). Seems there are more options around. Angus
  25. ICS defines Utf8String and Unicode string for old compilers. We still support Delphi 2007 since I still support my own commercial applications using it, but I stopped using Delphi 7 15 years ago. The original poster is making life more complicated for himself by using old ICS components. ICS v9 has a new sample Snippets, with several examples of making REST requests, one of which is: SslHttpRest := TSslHttpRest.Create (self) ; try try SslHttpRest.RestParams.AddItem('username', myusername); SslHttpRest.RestParams.PContent := PContUrlEncoded; StatCode := SslHttpRest.RestRequest(httpGET, myurl, False, ''); // sync request, no extra parameters AddLogText ('HTTP Rest Request Response: ' + IntToStr(StatCode)) ; if StatCode = 200 then begin AddLogText (SslHttpRest.ResponseRaw); AddLogText ('Address: ' + SslHttpRest.ResponseJson.AsArray[0].S['address']); end; except AddLogText ('HTTP Error - ' + IcsGetExceptMess (ExceptObject)) ; end ; finally FreeAndNil (SslHttpRest) ; end ; You completely ignore SslContext, encoding, Json, input and output steams, in most circumstances. There is a POST snippet, but it uploads a file. Angus
×