Tips and Frequently Asked Questions

 Using client-certificates with Sparkle in Windows


You can send client-certificates when performing HTTP requests using Sparkle, from Windows. The following code snippet shows how to do it. Two comments about the code:

a) You have to declare TInternalHTTPClient in the same unit you use the code below, preferable in the implementation section

b) This code snippet shows also how to retrieve the certificate from Windows store. It’s there as an example but you can and should replace with your own code to retrieve the certificate. That part of the code is not Sparkle-related and you should be familiar with the Windows API that handles certificates. The relevant Sparkle code is highlighted in bold.

TInternalHTTPClient = class(THttpClient)
end;
 
var
  httpClient: THttpClient;
  httpEngine: TWinHttpEngine;
  httpRequest: THttpRequest;
  httpResponse: THttpResponse;
  Store: HCERTSTORE;
  Cert: PCERT_CONTEXT;
begin
  httpClient := THttpClient.Create;
 
  // Open the ''Personal'' SSL certificate store for the local machine and locate the required client-side certificate
  Cert := nil;
  Store := CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, PChar(''MY''));
  if (Store <> nil) then
    Cert := CertFindCertificateInStore(Store, X509_ASN_ENCODING, 0, CERT_FIND_SUBJECT_STR, PChar(''mycertsubject''), nil);
 
  // If a valid certificate was found then OK to create and send the HTTP request
  if (Cert <> nil) then
  begin
    // Setup HTTP request properties
    httpRequest := httpClient.CreateRequest;
    ...

    // Use ''BeforeWinHttpSendRequest'' event to set any HTTP request properties such as client-side SSL certificate
    httpEngine := TWinHttpEngine(TInternalHTTPClient(httpClient).Engine);
    httpEngine.BeforeWinHttpSendRequest :=
      procedure (Req: HINTERNET)
      begin
        WinHttpCheck(WinHttpSetOption(Req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, Cert, SizeOf(CERT_CONTEXT)));
      end;

    // Execute HTTP request
    httpResponse := httpClient.Send(httpRequest);
  end;



Pricing

Single Developer License Small Team License Site License
 

TMS BIZ Essential


€ 395

120 yearly renewal
license for 1 developer


Includes
check  Aurelius
check  Sparkle
check  XData
check  Logging
close  Data Modeler
close  RemoteDB
close  Scripter
close  Sphinx
close  Echo
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
 

TMS BIZ Standard


€ 495

150 yearly renewal
license for 1 developer


Includes
check  Aurelius
check  Sparkle
check  XData
check  Logging
check  Data Modeler
check  RemoteDB
check  Scripter
close  Sphinx
close  Echo
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
MOST POPULAR

TMS BIZ Premium


€ 595

180 yearly renewal
license for 1 developer


Includes
check  Aurelius
check  Sparkle
check  XData
check  Logging
check  Data Modeler
check  RemoteDB
check  Scripter
check  Sphinx
check  Echo
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
BEST VALUE

TMS ALL-ACCESS


€ 1,795

575 yearly renewal
license for 1 developer


Includes
check  Aurelius
check  Sparkle
check  XData
check  Logging
check  Data Modeler
check  RemoteDB
check  Scripter
check  Sphinx
check  Echo
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
check  All TMS BIZ products
check  All TMS products
more_horiz  Discover more
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.

TMS ALL-ACCESS

key
Get unlimited access to all TMS products
local_offer
One money and time saving bundle

Free Trial

Start a free TMS BIZ evaluation today!
RAD Studio

What our customers say

As a developer for 30+ years, and a Delphi developer since 1996, I've a solid foundation on desktop development. But I was skeptical of indulging in web development. Though the market was demanding a switch, it seemed too difficult to make the transition. TMS Software was my "magic bullet" to get me started with zero intimidation. Love their Web Core and XData products. Now I can develop powerful web applications using Delphi. TMS Software has renewed my love for Delphi and won my heart for their innovators. Thanks to the team for great products and a large volume of demos and manuals. You ROCK!

- Larry

In the past I have purchased other components from other parties. I will say proudly that TMS is the best in support, price and style. Whenever I need a help your team is always there to help me. Keep up the good work

- Mohamed Thooloon

Hi Bruno Just want to drop you a line about how great your presentation was today. We often fail to point out to someone when they do a great job! You did a great job, you gave me a lot of ideas, and you answered my question very well. THANK you for your great products & super support.

- Lawrence Green

Thank you for developing components where I can best describe it like this: TMS components is a case where "The wheels fit the car, and NOT the car fit the wheels". Well done.

- Sathiparsad

As always your support is extraordinary and lightning fast.

-

TMS WEB Core

language
Create modern web apps in Delphi & VSC
build_circle
Use Object Pascal code to build JavaScript apps