Jump to content

Search the Community

Showing results for tags 'ics'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 33 results

  1. Hi All, I am creating a procedure to send HTML emails with images with ICS components. That would be great if it worked and we could have this procedure as an option so people can get started. I am having some issues, right now I am having an error 501 that should be about the recipient email, but I am adding a recipient email in the procedure. Here's the current procedure. MessageStatus is a procedure to update a status bar with a message. I am using that to see the messages during the process. I wish ICS also had a synchronous version of this component. ICSSendEmail.pas
  2. Am I correct that V9 is supposed to work on OSX? I am attaching a basic project that does nothing but have the needed ICS components on a form, linked together appropriately. It seems to build fine if I use the {$DEFINE FMX} Conditional but when I launch it, it freezes as shown in the attached CPU stack below. Any advice would be greatly appreciated as I'd really like to use this component as it seems so much faster than the built-in HTPPS components. Cheers, Ken Schafer ICS-V9 OSX Test Project.zip stack.txt
  3. HI there i just made a try, i started there! To work on the Android platform using compile directives, i needed to make some modifications to the code in several files. Lets focus on 'svn.overbyte.be/svn/icsv9/Source/OverbyteIcsUtils.pas'.The classTIcsIntegerList is essentially a wrapper around the TList class, since this code was designed for use in a Windows platform target, on a different platform, i needed to make some adjustments. type TIcsIntegerList = class(TObject) private FList : TList<Integer>; // Use TList<Integer> instead of TList function GetCount: Integer; function GetFirst: Integer; function GetLast: Integer; function GetItem(Index: Integer): Integer; procedure SetItem(Index: Integer; const Value: Integer); public constructor Create; virtual; destructor Destroy; override; function IndexOf(Item: Integer): Integer; function Add(Item: Integer): Integer; virtual; procedure Assign(Source: TIcsIntegerList); virtual; procedure Clear; virtual; procedure Delete(Index: Integer); virtual; property Count: Integer read GetCount; property First: Integer read GetFirst; property Last : Integer read GetLast; property Items[Index: Integer] : Integer read GetItem write SetItem; default; end; // ... other codes { TIcsIntegerList } function TIcsIntegerList.Add(Item: Integer): Integer; begin Result := FList.Add(Item); // No need to typecast Item to Pointer end; procedure TIcsIntegerList.Clear; begin FList.Clear; end; constructor TIcsIntegerList.Create; begin FList := TList<Integer>.Create; // Use TList<Integer> instead of TList end; procedure TIcsIntegerList.Delete(Index: Integer); begin FList.Delete(Index); end; destructor TIcsIntegerList.Destroy; begin FList.Free; inherited; end; function TIcsIntegerList.GetCount: Integer; begin Result := FList.Count; end; function TIcsIntegerList.GetFirst: Integer; begin Result := FList.First; // No need to typecast FList.First to Integer end; function TIcsIntegerList.GetLast: Integer; begin Result := FList.Last; // No need to typecast FList.Last to Integer end; // ... other codes but i faced a lot of errors when i target android platform and compiled, it gives me errors like: [DCC Error] OverbyteIcsUtils.pas(5931): E2023 Function needs result type [DCC Error] OverbyteIcsUtils.pas(5933): E2003 Undeclared identifier: 'FList' [DCC Error] OverbyteIcsUtils.pas(5933): E2003 Undeclared identifier: 'Item' [DCC Error] OverbyteIcsUtils.pas(5938): E2004 Identifier redeclared: 'TIcsIntegerList' [DCC Error] OverbyteIcsUtils.pas(5940): E2003 Undeclared identifier: 'FList' [DCC Error] OverbyteIcsUtils.pas(5945): E2037 Declaration of 'TIcsIntegerList' differs from previous declaration ...: So how to fix it? Or can anyone point me to the right direction?
  4. I have a huge app (pizzaprogram) running for 20+ years rock stable on hundreds of PCs, written in Delphi7, using: AlphaSkin + Indy + UIB + TVirtualStringTree also had 5 background threads running without any problems. (Some of them are using UIB.) This year I've started to work with `OverbyteIcsSslHttpRest, OverbyteIcsLogger, OverbyteIcsSslJose, OverbyteIcsSslX509Utils, OverbyteIcsWSocket, OverbyteIcsSuperObject, OverbyteIcsHttpProt, OverbyteIcsUtils, OverbyteIcsSSLEAY` units, running in a 6th separated thread. Since then, every 1-6 hours my program is crashing with EOutOfResources whenever AlphaSkin is trying to create or resize a bigger Bitmap. I've upgraded AlphaSkin from 2019 version to latest, but it did not help. (Actually it made it even worth, because the new version is generating 32bit bitmaps for every form and panel and button forehead.) The private memory consumption of my EXE is always under <150MB , usually 75MB Peak Virtual memory size < 300MB GDI number < 900 Please give me some hint / advice, how could I solve this mystery?
  5. Hello, I am using v8.71 of ICS. There is a device connecting to my application and sending some data. So, I basically wait for a connection and communicate with that device both ways. Occationally, TWSocketClient.OnDataAvailable event triggers even if there is no data ( aka GetRcvdCount = -1) I just wonder if this is normal and what might be possible reasons? Thanks & Regards, Ertan
  6. Hello I use TSslHttpCli in my backend built on DelphiMVCFramework for query external services. The TSslHttpCli object embedded into DelphiMVCFramework session and used each time then client called my endpoint. This call each time occurs in different thread. For certain reasons a can't create, use and free TSslHttpCli object each time in one thread context. I want to use thread context switching. Is this code safe? // initialization fClient: TSslHttpCli; ... fClient := TSslHttpCli.Create( nil ); fClient.MultiThreaded := True; // using if fClient.ThreadID = 0 then fClient.ThreadAttach; try fClent.Post(...); finally fClient.ThreadDetach; end;
  7. Hi, I am using TSslWSocket (TSslContext) to connect to TSslWSocketServer (using IcsHosts) Is it possible to avoid TSslContext on Client Side too ? I am asking because the Client side loses out some data initially upon just connecting. Without SSL same code work fine. I tried to prepare a small sample but that works fine with SSL too. I am using Delphi Seattle on Windows 10, Single machine, Two Exe's (Server and Client) for testing Regards Allan
  8. The function declarations for f_EVP_PKEY_get_raw_private_key() and f_EVP_PKEY_get_raw_public_key() each have a wrong parameter type: outlen: Integer. The correct type is outlen: size_t. On 64-bit, this can lead to memory overwrite if the 64-bit size_t is written to the 32-bit Integer. Reference: https://www.openssl.org/docs/man1.1.1/man3/EVP_PKEY_get_raw_private_key.html Ralf
  9. The patch below suggests fixes for 7 memory leaks in OverbyteIcsWSocket.pas. They surfaced after the OverbyteIcsSslWebServ.dpr sample project was linked against YuOpenSSL. A total of > 10k memory allocations reported not freed, adding up to > 500k bytes of leaked memory. The leaks were easy to spot because YuOpenSSL does not use the OpenSSL DLLs but compiles all OpenSSL code into the application binary. As a side effect, YuOpenSSL uses the Delphi memory manager and by default allows memory trackers to see OpenSSL memory allocations. Otherwise this does normally not happen when the OpenSSL DLLs employ their own memory management. The leaks then sum up in the DLLs' memory space, and out of sight of Delphi's memory trackers. For anyone who would like to test their ICS applications for memory leaks with YuOpenSSL, here is the link: https://www.yunqa.de/delphi/products/openssl/index Index: OverbyteIcsWSocket.pas =================================================================== --- OverbyteIcsWSocket.pas (revision 1492) +++ OverbyteIcsWSocket.pas (working copy) @@ -13933,7 +13933,8 @@ for I := 0 to Result - 1 do begin P := f_OPENSSL_sk_value(CertStack, I); if Assigned(P) then { V8.64 sanity test } - Add(f_X509_dup(PX509(P))); + // Add(f_X509_dup(PX509(P))); // ralfjunker fix memory leak. + Add(PX509(P)); // ralfjunker fix memory leak. end; end; @@ -14866,7 +14867,8 @@ OneErr := String(LastOpenSslErrMsg(FALSE)); OneErr := 'Error Cert ' + IntToStr(tot) + ' - ' + OneErr; end; - end; + // end; ralfjunker fix memory leak. + end else f_BIO_free(MemBio); // ralfjunker fix memory leak. // ignore private keys and other stuff if OneErr <> '' then begin @@ -17369,7 +17371,8 @@ procedure TX509Base.FreeAndNilX509Inters; { V8.41 } begin if Assigned(FX509Inters) then begin - f_OPENSSL_sk_free(FX509Inters); + // f_OPENSSL_sk_free(FX509Inters); // ralfjunker fix memory leak. + f_OPENSSL_sk_pop_free(FX509Inters, @f_X509_free); // ralfjunker fix memory leak. FX509Inters := nil; end; end; @@ -18334,7 +18337,10 @@ // pending, search stack for server certificate, might not be first { first in stack is server certificate } - SetX509(PX509(f_OPENSSL_sk_delete(MyStack, 0))); + // SetX509(PX509(f_OPENSSL_sk_delete(MyStack, 0))); // ralfjunker fix memory leak. + x := PX509(f_OPENSSL_sk_delete(MyStack, 0)); // ralfjunker fix memory leak. + SetX509(x); // ralfjunker fix memory leak. + f_X509_free(x); // ralfjunker fix memory leak. { remaineder are intermediates } if (TotInfo > 1) and (IncludeInters > croNo) then begin @@ -19394,7 +19400,8 @@ begin result := '' ; if not Assigned(X509) then Exit; - pubkey := f_X509_get_pubkey(X509); + // pubkey := f_X509_get_pubkey(X509); // ralfjunker fix memory leak. + pubkey := f_X509_get0_pubkey(X509); // ralfjunker fix memory leak. Result := GetKeyDesc(pubkey); end; @@ -19500,17 +19507,27 @@ {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure TX509Base.LoadIntersFromPemFile(const FileName: String); { V8.41 } +var // ralfjunker fix memory leak. + x: PStack; // ralfjunker fix memory leak. begin InitializeSsl; - SetX509Inters(IcsSslLoadStackFromInfoFile(FileName, emCert)); + // SetX509Inters(IcsSslLoadStackFromInfoFile(FileName, emCert)); // ralfjunker fix memory leak. + x := IcsSslLoadStackFromInfoFile(FileName, emCert); // ralfjunker fix memory leak. + SetX509Inters(x); // ralfjunker fix memory leak. + f_OPENSSL_sk_free(x); // ralfjunker fix memory leak. end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure TX509Base.LoadIntersFromString(const Value: String); { V8.41 } +var // ralfjunker fix memory leak. + x: PStack; // ralfjunker fix memory leak. begin InitializeSsl; - SetX509Inters(IcsSslLoadStackFromInfoString(Value, emCert)); + // SetX509Inters(IcsSslLoadStackFromInfoString(Value, emCert)); // ralfjunker fix memory leak. + x := IcsSslLoadStackFromInfoString(Value, emCert); // ralfjunker fix memory leak. + SetX509Inters(x); // ralfjunker fix memory leak. + f_OPENSSL_sk_free(x); // ralfjunker fix memory leak. end;
  10. Hi, I use THttpCli component (ICS v8.61) for downloading files. It works well in many case, but when I try pass a parameter with space (encoding with "+" or "%20") I have the error 400 Bad Request Why? What can I do? PS: if I put the url in a browser, the request is successful text/html; charset=iso-8859-1 => CONSEGNA Attestazione avvenuta pubblicazione avviso selezione infermiere.eml Location = http://192.168.2.221/cbadoc/upload/2019/08/14/CONSEGNA Attestazione avvenuta pubblicazione avviso selezione infermiere.eml URL = http://192.168.2.221/cbadoc/download.php?file=CONSEGNA+Attestazione+avvenuta+pubblicazione+avviso+selezione+infermiere.eml&id=20878&liv1=2019&liv2=08&liv3=14 Document = CONSEGNA Attestazione avvenuta pubblicazione avviso selezione infermiere.eml RequestDone, no error. Status = 400 Request Failed ! StatusCode = 400 ReasonPhrase = Bad Request
  11. How to send files to an API using TSslHttpRest? In Postman I can, this is the http code: POST /api/br-invoice-integration/v1/batches HTTP/1.1 Host: qed.onvio.com.br Accept: application/json Authorization: Bearer 42dc0b99-2d17-4898-9c85-0b52ae364c63Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file[]"; filename="/C:/MyFile.xml" Content-Type: text/xml (data) ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="query" {"boxe/File":true} ----WebKitFormBoundary7MA4YWxkTrZu0gW With SslHttpRest, I'm trying to SendStream, like that (similar to the sample OverbyteIcsHttpPost1): FileName := 'C:\MyFile.xml'; RandBoundary := '-----------------------------' + IntToHex(Random(MaxInt), 8) + IntToHex(Random(MaxInt), 8); SslHttpRest1.ContentTypePost := 'multipart/form-data; boundary=' + RandBoundary; Header := RandBoundary + #13#10 + 'Content-Disposition: form-data; name="file[]"; filename="' + 'MyFile.xml' + '"' + #13#10 + 'Content-Type: text/xml' + #13#10 + #13#10; Footer := RandBoundary + #13#10 + 'Content-Disposition: form-data; name="query"' + #13#10 + #13#10 + '{"boxe/File":true}' + #13#10 + RandBoundary + #13#10; SslHttpRest1.SendStream := TMultiPartFileReader.Create(Filename, Header, Footer); SslHttpRest1.SendStream.Position := 0; SslHttpRest1.RestRequest(httpPOST, Myurl); But it doesn't work, just get error: Request completed: 500 Request done, StatusCode #500 {"error":{"code":500,"errors":[],"message":"HTTP 400 Bad Request"}} Has anyone ever needed to do something similar, would this be the way? If anyone can help, I appreciate it.
  12. Hello Community, since last week I have been trying to let a TsslWSocket and a TsslWSocketServer communicate with each other. I want to get a long-term stable connection between a TCP client and a TCP server that is secured with TLS1.3. However, after a runtime of a few minutes, the data transfer breaks down. There is a client thread and a server thread. In the respective Execute method I create the socket and initialize it, call Listen (server) or Connect (client) and run the MessageLoop. After a successful SSL handshake, my client sends 128KB data packets to the server. The data arrives at the server, TwSocketClient.onDataAvailable is triggered, the bytes can be read there with TwSocketClient (Sender).Receive (pBuffer ...). When the server has received 128KB, it sends an "ACK" packet to the client (An AnsiString "ACK", 3 bytes). When the client receives the packet, it sends again 128KB of testdata. This works a few thousand, sometimes some tenthousands times, until TwSocketClient.onDataAvailable is suddenly no longer called. There is no OnSessionClosed, no onError, no onException and also no onBgException that would indicate a problem. Apparently the problem is on the client side: A running Wireshark shows an [ACK] packet from the server to the client as last entry. Further clicks on the "Manual Send" button do not lead to any further lines in the Wireshark log. When this state has been reached another client can connect to the server without any problems, so the server is not completely dead. I have no idea what I could do wrong ... Maybe it's not ok to send in the context of another thread? But how is that supposed to work when the client thread is blocked by the MessageLoop? Simultaneous web browsing leads to the problem faster. When I look at any website, it usually takes less than half a minute to see the problem. My test project is attached. I would be interested to know if you have observed the same problem and if anyone has a guess as to what might be the cause ... The project is complete, the Win32 folder also contains the certificate used for testing ... Usage: Enter your own IP address, press the "btCreateStart" button, then the "btSendData Manual Send" button. The "logICStest.log" file in the program directory grows until the problem occurs ... Thanks in advance... P.S: I have already tried not to send after receiving the ACK packet, but cyclically via timer or thread. If you can select both in the test project with checkboxes, the result is the same. The problem does not only occur with TLS1.3, also with TLS1.2. I even think it shows up without encryption, just takes longer ... I crossposted this in the german Delphi-Praxis in german language (https://www.delphipraxis.net/205223-stabile-tcp-verbindung-mit-ics-ich-kriegs-nicht-hin.html)... Test Overbyte ISC Client und Server.7z
  13. EVP_PKEY_paramgen() pkey should be a double pointer parameter. OverbyteIcsLIBEAY.pas line 1752, SVN 2063: f_EVP_PKEY_paramgen: function(pctx: PEVP_PKEY_CTX; pkey: PEVP_PKEY): Integer; cdecl = Nil; Notice the two ** asterisks in the OpenSSL's evp.h C declaration: int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); Possible fixes: { More C like: Better if ppkey may be nil. } f_EVP_PKEY_paramgen: function(pctx: PEVP_PKEY_CTX; ppkey: PPEVP_PKEY): Integer; cdecl = Nil; { More Pascal like. Notice that nil cannot be passed this way. } f_EVP_PKEY_paramgen: function(pctx: PEVP_PKEY_CTX; var pkey: PEVP_PKEY): Integer; cdecl = Nil; Reference: https://www.openssl.org/docs/man1.1.1/man3/EVP_PKEY_paramgen.html Ralf
  14. f_CRYPTO_get_ex_data should return Pointer, not Integer. The code in question is at OverbyteIcsLIBEAY.pas line 1847, SVN 1476: f_CRYPTO_get_ex_data: function(r: PCRYPTO_EX_DATA; idx: integer): integer; cdecl = Nil; The corresponding C declaration from OpenSSL's crypto.h: void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx); Suggested solution: f_CRYPTO_get_ex_data: function(r: PCRYPTO_EX_DATA; idx: integer): Pointer; cdecl = Nil; Reference: https://www.openssl.org/docs/man1.1.1/man3/CRYPTO_get_ex_data.html Ralf
  15. At the time of this writing, TCryptoExNewFunc is declared as a function while it should be a procedure. OverbyteIcsLIBEAY.pas line 1752, SVN 1476: TCryptoExNewFunc = function(parent: Pointer; ptr: Pointer; ad: PCRYPTO_EX_DATA; idx: integer; argl: DWord; argp: Pointer): Integer; cdecl; This is the corresponding C declaration from OpenSSL's crypto.h, documented here: https://www.openssl.org/docs/man1.1.1/man3/CRYPTO_EX_new.html typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp); This is the Pascal translation matching the C declaration: TCryptoExNewFunc = procedure(parent: Pointer; ptr: Pointer; ad: PCRYPTO_EX_DATA; idx: integer; argl: DWord; argp: Pointer); cdecl; Ralf
  16. In OverbyteIcsWSocket.pas, PunyServerName is always filled with 8-bit data, even if it is a 16-bit UnicodeString on Unicode Delphis. This happens in OverbyteIcsWSocket.pas line 15916 (SVN 1469): Move(DataExt[5], Ws.FCliHelloData.PunyServerName[1], Slen); The line above works well with non Unicode Delphis, but copies incorrect data in Unicode enabled Delphis. Cause is the declaration of PunyServerName (line 3488): TClientHelloData = record ServerName: String; PunyServerName: String; // <-- Problem here. ... Later on, this results in incorrect conversion to ServerName. See that the OverbyteIcsSslWebServ demo outputs garbled SNI and Server Name instead of localhost: HTTPS Server is waiting for connections https://localhost/demo.html HTTP Server is waiting for connections http://localhost/demo.html [10:17:36 127.0.0.1] SNI "潬慣桬獯t Client Hello: Server Name: 潬慣桬獯t [10:18:15 127.0.0.1] SNI "潬慣桬獯t Client Hello: Server Name: 潬慣桬獯t A quick remedy is to declare PunyServerName as AnsiString and work around the warning "OverbyteIcsWSocket.pas(15968): W1057 Implicit string cast from 'AnsiString' to 'string'", possibly be adding a typecast. TClientHelloData = record ServerName: String; PunyServerName: AnsiString; // <-- 8-bit string, even in Unicode Delphis. ... Ralf
  17. OverbyteIcsLIBEAY.pas line 1994 (SVN 1469) declares f_EVP_DigestSignInit() like this: f_EVP_DigestSignInit: function(ctx: PEVP_MD_CTX; pctx: PEVP_PKEY_CTX; etype: PEVP_MD; impl: PEngine; pkey: PEVP_PKEY): Integer; cdecl = Nil; In Pascal, pctx is a single pointer, but C declares pctx as a double pointer: int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); Following nearby declarations, Pascal should probably change pctx to a var parameter. Reference: https://www.openssl.org/docs/man1.1.1/man3/EVP_DigestSignInit.html Ralf
  18. Dear All, I need to fill two fields in a form and then submit it. As I'm not well versed in this area, I come here and for some guidance. The page where they sit is coded as follows: <html> <body> <form id="form1" name="form1" action="envia_arq2.php" method="post"> Senha: <input TYPE="password" NAME="senha" SIZE="12"><br /><br /> Seu nome: <input TYPE="text" NAME="nome" SIZE="12"> <input name="enviar" type="submit" value="Enviar"> </form> </body> </html> This is a FMX application, so I can't use TWebBrowser as I've found in several articles in the internet. Furthermore, even the VCL version I couldn't make work, after navigating to the page the Document property is nil, making it impossible to retrieve the fields as indicated in those articles. I then moved on to ICS TSslHttpCli, tried a few basic things, but I came up empty on the very first attempt where I just set the URL (https://www.trivial.com.br/envia_arq2.htm) and did a GET to try and see how to proceed from there. An exception is raised signaling a missing SSL Context. Perhaps this is not the way to go. Could you please kindly share some light on this? Thanks in advance. -- Carlos
  19. OverbyteIcsSSLEAY.pas line 2160 (SVN 1464) declares f_SSL_set_msg_callback() to use a TProto_msg_cb callback. TProto_msg_cb is defined in line 1270 as a function: TProto_msg_cb = function (write_p, version, content_type: integer; buf: PAnsiChar; size_t: integer; ssl: PSSL; arg: Pointer): Integer; cdecl; { V8.40 handshake protocol message callback } This is different from the OpenSSL definition. The C header declares the callback as a procedure which does not return a value (void): void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); Reference: https://www.openssl.org/docs/man1.1.1/man3/SSL_set_msg_callback.html Ralf
  20. OverbyteIcsSSLEAY.pas line 2097 (SVN 1464) declares f_SSL_clear() like this: f_SSL_clear: procedure(S: PSSL); cdecl = nil; This is different from the OpenSSL definition. The Pascal declaration is a procedure, but the C declaration a function with an Integer return value: int SSL_clear(SSL *ssl); Reference: https://www.openssl.org/docs/man1.1.1/man3/SSL_clear.html Ralf
  21. OverbyteIcsSSLEAY.pas line 2095 (SVN 1464) declares f_SSL_bytes_to_cipher_list() like this: f_SSL_bytes_to_cipher_list: function(s: PSSL; cbytes: PAnsiChar; len: size_t; isv2format: Boolean; sk, scvsvs: PSTACK_OF_SSL_CIPHER): LongInt; cdecl = nil; { V8.64 } This is different from the OpenSSL definition. The Pascal declaration passes sk and scvsvs as simple pointers, instead of pointer addresses or var parameters. In contrast, the C header uses a double pointer for both parameters: int SSL_bytes_to_cipher_list(SSL *s, const unsigned char *bytes, size_t len, int isv2format, STACK_OF(SSL_CIPHER) **sk, STACK_OF(SSL_CIPHER) **scsvs); Reference: https://www.openssl.org/docs/man1.1.1/man3/SSL_bytes_to_cipher_list.html Ralf
  22. Samples\Delphi\SslInternet\OverbyteIcsHttpsServer1.pas line 415 has a reference to OverbyteIcsWSocket.SslWSocketCopyRight which does not exist: Display(' ' + Trim(OverbyteIcsWSocket.SslWSocketCopyRight)); As a result, the OverbyteIcsHttpsServer1.pas unit does not compile. Ralf
  23. OverbyteIcsLIBEAY.pas line 2336 (SVN 1464) declares f_X509_check_ip_asc() like this: f_X509_check_ip_asc: function(Cert: PX509; Paddress: PAnsiChar; namelen: size_t; flags: Cardinal): Integer; cdecl = nil; This is different from the OpenSSL definition. The Pascal declaration has an extra namelen parameter not present in the C header: int X509_check_ip_asc(X509 *, const char *address, unsigned int flags); Reference: https://www.openssl.org/docs/man1.1.1/man3/X509_check_ip_asc.html Ralf
  24. OverbyteIcsWSocket.pas has at least one small memory leak. In line 17009 (SVN 1464), an X509Obj is duplicated before its is added to the list. However, TX509Base.Create() duplicates the duplication once more before TX509List.Add() stores it to the list. The first duplicated object is never freed, resulting in the leak. This is the line in question: CertList.Add(f_X509_dup(f_X509_OBJECT_get0_X509 (MyX509Obj))); The fix is to remove f_X509_dup(), so the line looks like this: CertList.Add(f_X509_OBJECT_get0_X509 (MyX509Obj)); Code analysis suggests that a similar leak is present in line 15012, but I have not been able to trigger this code running one of the Sample projects: Cert.AddToInters(f_X509_dup(f_X509_OBJECT_get0_X509 (MyX509Obj))); Ralf
  25. I am using ICS TSslFTPServer (FtpSslType=ftpAuthTls,ftpAuthSsl) and TSslWSocketServer (SslEnable=True) on my Server side application along with TSslContext wherein I am pointing to SslPrivKeyFile and SslCertFile to your sample 01key.pem and 01cert.pem respectively. My Client Application connects and all is well. problem-1) If I try to change the certificates to another of your provided examples or If I build with OpenSSL it gives error 'Can't read certificate file ... error:0909006C:PEM routines:get_name:no start line' problem-2) Using SSL I lose compatibility with WinXP and probably with Vista too. Is there a workaround ? (Angus has suggested me to use the IcsHosts property instead of SslContext but I will need to do more work to get it working for me, hope I am using above mentioned components properly to begin with SSL) (How I generated my own PEM files openssl genpkey -aes256 -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out 01key.pem openssl pkey -in 01key.pem -out 01cert.pem -pubout)
×