I'm using TRESTClient from Delphi XE8 to send JSON/REST requests to a specific remote server. I want to make sure that TRESTClient only establish a connection to servers with a certificate signed by a specific root authority certificate (known as certificate pinning). How can I solve this with TRESTClient?
It may be possible with OnVerifyPeer() event from TIdSSLIOHandlerSocketOpenSSL as stated on Delphi Indy verify server certificate SSL, but afaik I can not access SSL socket options through TRESTClient.
There exists an event TRESTClient.OnValidateCertficate(), but this event only receives a TCertificate record - not containing any useful information (just valid from, issuer name etc.)