Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: TRESTClient OnNeedClientCertificate missing ?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Mar 5, 2018 3:54 AM Last Post By: Christophe LACH
Christophe LACH

Posts: 37
Registered: 12/2/01
TRESTClient OnNeedClientCertificate missing ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 31, 2015 3:51 AM
I need to connect to a REST server that requires me to provide a specific client certificate.

How can I do this with TRESTClient ?

I get an error message when calling RestRequest.Execute saying "Unspecified certificate from client"

Please help !
thanks

PS: Using XE8 update 1
Armindo DA SILVA

Posts: 1
Registered: 9/29/15
Re: TRESTClient OnNeedClientCertificate missing ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 14, 2018 1:40 AM   in response to: Christophe LACH in response to: Christophe LACH
Hi Christophe,

have you solved your problem ?
I have the same problem.

Best regards
Christophe LACH wrote:
I need to connect to a REST server that requires me to provide a specific client certificate.

How can I do this with TRESTClient ?

I get an error message when calling RestRequest.Execute saying "Unspecified certificate from client"

Please help !
thanks

PS: Using XE8 update 1
Christophe LACH

Posts: 37
Registered: 12/2/01
Re: TRESTClient OnNeedClientCertificate missing ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 1, 2018 8:03 AM   in response to: Armindo DA SILVA in response to: Armindo DA SILVA
Armindo DA SILVA wrote:
Hi Christophe,

have you solved your problem ?
I have the same problem.
I get an error message when calling RestRequest.Execute saying "Unspecified certificate from client"

Hi Armindo,

You are lucky I was just wandering here :)

With Delphi Tokyo they added a class helper that does exactly this (add the missing feature) TRESTClientHelper = class helper for TCustomRESTClient ...
but I did not test it yet because our tokyo migration was stopped by and incompatible third party component.

My own solution with XE8 was to patch the units
REST.client and REST.httpclient in {delphi install path]\source\data\rest\
and expose the missing properties forgotten by ingeneers :)
property OnNeedClientCertificate: TNeedClientCertificateEvent read GetOnNeedClientCertificate write SetOnNeedClientCertificate;
property OnValidateCertificate: TValidateCertificateEvent read GetOnValidateCertificate write SetOnValidateCertificate;

There is also another solution provided by Roy nelson from Embarcadero support with a RTTI hack.

What do you prefer, the upgrade, the patch or the hack ?

I can't remember well the patching process, but it was fairy easy.

The hack is also easy to use ... but if you patch the Helper class should automatically work when you upgrade later.

PS: if you want the RTTI hack just ask (but I have no way to ask Roy is he agrees to share the code).
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02