Jump to content

Angus Robertson

Members
  • Content Count

    1881
  • Joined

  • Last visited

  • Days Won

    33

Everything posted by Angus Robertson

  1. I'm afraid OpenSSL is the cross platform solution. Or one of it's forks. While there are native Delphi cryptography libraries, I've never seen a native library handling X509 certificates and PKCS-8 private keys.. Angus
  2. Angus Robertson

    SMS Sending - Still valid??

    No idea about that Indian company, but there are lots of similar companies offering SMS HTTP APIs, at varying prices and levels of reliability in delivery, I use https://thesmsworks.co.uk/developers (which is also supported by ICS). You'd have to adjust the parameters slightly. Angus
  3. That code is creating a digital signature using a private key and Sha-256. Windows does have various old high level APIs for signing, using Capicom or Mssign32.dll, I use Capicom to check the digital signatures on EXE files. There must be low level APIs for signing as well, but I've never looked for them or used them, OpenSSL is so simple, albeit a large overhead since there is so much you don't need. YuOpenSSL links it's into your application to avoid DLL hell. Angus
  4. Angus Robertson

    TCP server rejecting connections

    Which ICS version were you using? As I said earlier, there is a limit to the number of new SSL/TLS connections per second due to socket server being a single thread. I've previously said in this forum there is a plan for a heavy socket server, which will be configurable for x clients per thread, two threads in theory would double the number of new connections per second, but it could be one thread per client. This will need a new web server as well. But I really need ICS end users with server applications involving thousands of clients to justify the effort developing it. Would that be of interest? Angus
  5. Angus Robertson

    TCP server rejecting connections

    It is important to handle the onBgException exception event, and Application.OnException. Recent ICS releases have improved BgException messages to help track the origin. I log the errors, send an admin email and then stop the service, so Windows can immediately restart it. Unfortunately, some SSL problems do not trigger any events and just crash the program, but it does restart. Angus
  6. Angus Robertson

    TCP server rejecting connections

    I was having a problem with one of my servers not listening under some circumstances, so implemented an internal watch dog that made a connection attempt every minute, very simple using TSslHttpRest;, just a few lines of code triggered from the maintenance timer. Worked well, but showed the server was still listening. The problem turned out to be two services using the same named firewall rule updated each time they started to the current EXE name, so dependent upon the order in which the servers started. Angus
  7. Angus Robertson

    TCP server rejecting connections

    My previous SSL/TLS testing shows there is a limit to the number of new connections per second, due to time taken to setup SSL/TLS and all the handshaking involved. There is a server setting ListenBackLog which defaults to 15, that means Windows will only queue 15 new connections before rejecting any further attempts. You could also try increasing your timeout beyond 60 seconds, to reduce the number of new connections. An established connection is low overhead, new one high overhead, provided you have sufficient handles and resources to open the total number. TLS/1.3 has faster setup than TLS/1.2, if you can use it. You may also be able to optimize certificate chain checking, the less the faster. Angus
  8. Angus Robertson

    No exception handling with server crash

    Thanks, my issue does seem to be OpenSSL DLL related, although the same ResetSslSession function may have been called dozens of times during the FTP session, twice for each file uploaded or downloaded, or not once if the session fails due to authentication. I should really try with older DLLs and 3.0 built elsewhere. Although none of this explains why the same program built with Delphi 2007 has worked fine on all my servers for 15 years, with various OpenSSL releases, maybe that is PE header related. Angus
  9. Angus Robertson

    No exception handling with server crash

    Logging works before SSL_free is called, but nothing afterwards. This function is called for every SSL connection in ICS, there is no way anything is getting corrupted on a platform basis. During a normal close down, the ResetSslSession function gets called a second time with all the various pointers nulled, and behaves itself. Setting up remote debugging will be tedious, and I doubt would be productive. It's only the FTP server that seems unhappy, the D10/D11 web server has been running for over a year. Angus
  10. Angus Robertson

    No exception handling with server crash

    I added syslog logging to the sample so now have logs up to the point of crashing, which is in our function ResetSslSession while closing various handles. The crash happens after a call to SSL_free(FSsl), but the exception handler does not catch it. But this still only happens for a remote connection to the server, not locally. The remote connection does raise an earlier abort network error, but this is ignored. So ultimately the problem does not seem to be anything to do with our Delphi code, but with the runtimes in the OpenSSL DLL. Angus
  11. Angus Robertson

    No exception handling with server crash

    Thanks, even if I managed to create a process dump at the moment of corruption, I really would not know how to go looking for the line that caused the problem. Or why that line only fails in certain but 100% reliably repeatable circumstances, which do not include under the Delphi debugger. Angus
  12. Angus Robertson

    Delphi 10.4.2 won't open a specific .PAS file

    I also have units with underscores, but this was a form so perhaps different rules apply, did not think much of it at the time since I was skipping past the hundreds of modal dialog box errors Delphi gives when opening a project with components that are not currently installed, why no 'ignore all' button and why no logging of all the errors? It's so frustrating when you migrate projects or update Delphi. Angus
  13. Angus Robertson

    Delphi 10.4.2 won't open a specific .PAS file

    Recent versions of Delphi seem to dislike units with underscores, I'm currently converting some Delphi 2007 projects to D11 and renamed two units so far to remove underscores. Angus
  14. Angus Robertson

    Printer ip

    So what did you see in your browser when you viewed https://www.whatismyip.com/ ? Exactly what you are asking for? That particular site might just disappear, so long term it would be better to use a STUN client widely used for VoIP. Angus
  15. Angus Robertson

    Gmail Subject not sending Non English Character

    Sorry, this was incorrect, the ICS SMTP component does automatically inline MIME encode any 8-bit characters, if you have SmtpCli.Allow8bitChars and SmtpCli.ConvertToCharset both false, and set SmtpCli.Charset to 'utf-8', which is not the default. Angus
  16. Angus Robertson

    ICS V8.69 announced

    ICS V8.69 has been released at: http://wiki.overbyte.eu/wiki/index.php/ICS_Download ICS is a free internet component library for Delphi 7, 2006 to 2010, XE to XE8, 10 Seattle, 10.1 Berlin, 10.2 Tokyo, 10.3 Rio, 10.4 Sydney and 11.0 and C++ Builder 2006 to XE3, 10.2 Tokyo, 10.3 Rio, 10.4 Sydney and 11.0. ICS supports VCL and FMX, Win32, Win64 and MacOS 32-bit targets. The distribution zip includes the latest OpenSSL 3.0.1 win32, with other versions of OpenSSL being available from the download page. Major Changes in ICS V8.69 include: 1 - V8.69 has a lot of minor improvements, more HTTP client and server features, better built-in authentication, and added built in file uploading to the REST client component. Also continuing improving all the HTTP samples so they now hopefully test all the features of the ICS HTTP server, specifically adding POST and PUT file uploading, and a new client login window for interactive authentication with servers. Also added OCSP (Online Certificate Status Protocol) to ICS, which is used to check SSL/TLS certificates are legitimately issued and not revoked. 2 - In the HTTP client, added new methods RequestAsync and RequestSync which start a specified request by parameter, useful to repeat the last request from an event (such as should be trust the certificate and repeat). When using a proxy, make sure Path is not blank which will break proxies, change to / as for non-proxy requests. GetRequestDoneErrorStr now handles TWsocket errors. Fixed NTLM authentication which got broken in V8.61. Added a new THttpAuthType of httpAuthDigest2 for Digest with the modern SHA-256 algorithm instead of MD5 used by httpAuthDigest, only with USE_SSL. Added new property WWWAuthInfos array filled after 401/407 failure by parsing AuthorizationRequest headers for AuthType and Realm that may be presented to select an authentication option, get login and repeat request. Remove # fragment anchor rom the URL unless the new Option httpoAllowAnchor is set. 3 - In the HTTP REST client, added built in file uploading using POST or PUT. The file name is specified in HttpUploadFile using type HttpUploadStrat ofHttpUploadSimple with parameters in the URL or HttpUploadMIME for multipart with parameters in the first MIME part. Note the applications needs to supply parameters like FileName so the server knows what to do with the file. This may be tested against the ICS web server samples. Upon request completion, ReasonPhrase now also has status, so OK becomes 200 OK, etc. Previously the SslRevocation property was only effective when checking the windows certificate store, now it also works with bundle files using the new TOcspHttp component and OCSP stapling if available. 4 - In the HTTP server component, now converting FLastModified to UTC/GMT time for the response header. Added new authentication type atDigestSha2 with a SHA256 hash instead of MD5 with atDigest only supported with USE_SSL. Note: Mozilla Firefox supports Digest SHA-256, Chrome and Edge do not. Added a new client connection OnHttpRespHdr event to allow response headers to be logged, previously only request headers could be logged. Cleaned up AnswerStream functions so separate lines don't go into send buffer. Added OcspSrvStapling property which should be set to enables OCSP checks and stapling only with AUTO_X509_CERTS define since it adds extra HTTP client code. A revoked certificate will be auto ordered. 5 - In TWSocket, added new method SendTB(const Data: TBytes; Len: Integer=-1) where Len is optional, also similar SendToTB and SendToTB6 with TBytes, as an alternative to casting such types to use Send(). Restored the TlsExtension_cb callback for client debugging since ClientHelloCallback only works with servers. 6 - In TSslWSocketServer added OCSP (Online Certificate Status Protocol) support with IcsHosts using the TOcspHttp component to confirm server SSL/TLS certificates are legitimate and not revoked for security reasons. The certificate OCSP response is also stapled to the initial SSL/TLS HELO handshake and sent to the client to avoid it needing to lookup OCSP using HTTP itself. OCSP responses are cached and saved to a file for reloading later, but are refreshed every time the certificate is validated, at least once a day. The new server property OcspSrvStapling enables OCSP checks and stapling only with AUTO_X509_CERTS define since it adds extra HTTP client code. A revoked certificate will be auto ordered. OCSP checking is done in LoadOneCert and the stapled response sent in TriggerSslServerName when checking SNI. The same OCSP support is available in all ICS servers that use IcsHosts, including FTP, HTTP and TIcsIpStrmLog. 7 - All three main HTTP SSL client sample applications FrameBrowserIcs, OverbyteIcsHttpsTst and OverbyteIcsHttpRestTst now support interactive authentication with a new Login window that displays the different methods the server will accept (from the new property WWWAuthInfos array) allowing one to be selected from Basic, Digest MD5, Digest SHA256 and NTLM logins. This window is displayed after an 401 error and the request then repeated. 8 - The OverbyteIcsHttpsTst SSL sample now has all the missing features from the non-SSL samples, Content Encoding Gzip tick box to support compression, persistent cookie support, POST/PUT support to either send simple data or upload files in various ways (from OverbyteIcsHttpPost1 sample), may be tested against the ICS web server samples. 9 - The OverbyteIcsDDWebService SSL web server sample now builds on unicode compilers. Added authentication for POST requests and new 'Password protected page (POST)' button on the demo menu to test authentication using POST. Fixed web logging to log correct multiple listener. Builds on unicode compilers. Added Digest SHA-256 authentication page DemoDigest2Auth.html and DemoDigestsAll.html that does both digests. DemoAuthAll.html no longer does NTLM, use the separate page. Now displays server response headers if box ticked, only displayed request headers before. File Upload Form and Email Form pages now work without exceptions. The OverbyteIcsSslMultiWebServ SSL web sample has similar new authentication features and logging fixes. 10 - Updated OpenSSL to 3.0.3 and ZLIB (HTTP compression) to 1.2.12, sorry for long delay in updating zlib, now including some important bug fixes, although never saw any issues with the minimal use ICS makes of it. Updated the various ICS CA Trusted Stores. 11 - The OverbyteIcsPemtool SSL sample now does OCSP checks when examining certificate files. There is also a new Test Host Certificates tab that tests SSL/TLS handshake and certificates (using TIcsIpStrmLog) for a list of host names and ports, building a list of host and intermediate certificates that may be further checked and saved as files or added to an intermediate bundle. This new tester should prove useful for debugging sites that return SSL or certificate errors. More detailed release notes are at http://wiki.overbyte.eu/wiki/index.php/ICS_V8.69
  17. Angus Robertson

    ICS V8.69 announced

    We build IcsCommonD110Run almost daily during development of ICS. Many others have installed it without any errors reported. This would suggest you either have a corrupted version of ICS, unlikely since GetIt also failed, or something is strange about your installation. Angus
  18. Angus Robertson

    Which Package to Install

    The content of the ICS packages has not changed in over 10 years or longer, since Delphi XE2 except for new units being added. If you want only VCL you install only the two OverbyteIcsDxx packages, if you want FMX as well you only install the three IcsCommonDxx packages, as explained in the readme8 file. Using the install groups is much easier, DxxInstall or DxxInstallVclFmx. There is a Build Group in modern compilers, so a couple of clicks builds all the packages for Win32 and Win64. GetIt is the same, VCL only or VCL/FMX. Angus
  19. Angus Robertson

    K-Software

    Did Sectigo also ask you for a selfie with your passport? On a general note, worth mentioning that buying Code Signing certificates will become more expensive and difficult from this autumn when software private keys are banned, you'll need to buy your certificate on a physical dongle probably adding $100 or more to the price, plus shipping and customs hassle for those outside the country where the certificate is sold. This was the reason I bought a three year certificate earlier this year. Angus
  20. Angus Robertson

    sending text between applications (10)

    Never used Windows Mailslots, don't see any advantage over using sockets, they are limited to messages no more than 424 bytes, and I'd guess are dependent on various network services running. Microsoft recommends named pipes or sockets as the modern replacement. Angus
  21. Angus Robertson

    K-Software

    K-Software support is almost non-existent, totally automated, probably how they are able to offer code signing certificates vastly cheaper than anyone else. I bought a three year certificate in January, it all worked, they resell Sectigo, you should get an email from certs@ksoftware.net with a link that starts the process, which is fun since it requires Internet Explorer that has now been discontinued. Eventually Sectigo will contact you to confirm your personal identity using your passport and the certificate will be issued, that is why I paid $188 for three years ($500 from Sectigo) to put off doing it all again. Good luck. Angus
  22. Angus Robertson

    Are the jcl and jvcl libraries still alive?

    I have the same opinion of Github, it's fine for complex projects with lots of contributors, but far more complicated than SVN for projects with a small number of trusted contributors. Github may be safer, but at the expense of extra time for project owner merging contributions. I only contributed to a Github project once, it was so tedious I now just email the project owner who is welcome to ignore my contributions. That is why ICS still uses SVN, which I host on my own public servers (mostly runs itself). But I'm also retired and not willing to spend much time learning new technology. Angus
  23. The log shows a single un-authenticated request resulting in a 401 response, no attempt to send authentication or repeat the request. The sample would have brought up a dialog box asking for a password to be entered and repeated the request. Sorry, but there is no point in posting logs that don't illustrate any real activity or problems. BTW, beware of posting real authentication details in an open conference. Angus
  24. The IcsLogger is designed for low level SSL development, not application protocol debugging. Try reproducing the problem using the OverbyteIcsHttpRestTst sample with debug logging set to HTTP headers and set a log directory, then send the complete log, not selected extracts, indicating where it fails. If you can not reproduce the bug in that sample in V8.69, the problem is your code. Angus
  25. If I can not reproduce a problem, I can not fix it. You will need to reproduce using a public server. Or against the ICS web server sample which supports all authentication methods. Angus
×