You are not logged in.
Hello,
I was trying to set the IgnoreSSLCertificateErrors property of the TWinHTTPAPI object from within a TSQLHttpClientWinHTTP, but I encountered a problem.
Here's the code I wrote:
aClient := TSQLHttpClientWinHTTP.Create(addr, SERVER_PORT, aModel, true);
aClient.WinAPI.IgnoreSSLCertificateErrors:=true; // ERROR because aClient.WinAPI is still nil here
Examining your code I have noticed that TSQLHttpClientWinHTTP.Create does not create its WinAPI internal object, such object is created by the InternalCheckOpen method.
As a temporary solution I have modified the code of your TSQLHttpClientWinHTTP.Create constructor as follows:
constructor TSQLHttpClientWinGeneric.Create(const aServer, aPort: AnsiString;
aModel: TSQLModel; aHttps: boolean; const aProxyName, aProxyByPass: AnsiString;
SendTimeout,ReceiveTimeout: DWORD);
begin
inherited Create(aServer,aPort,aModel);
fHttps := aHttps;
fProxyName := aProxyName;
fProxyByPass := aProxyByPass;
fSendTimeout := SendTimeout;
fReceiveTimeout := ReceiveTimeout;
InternalCheckOpen; // added this line
end;
But it's not a clean solution. I think that propagating/adding the IgnoreSSLCertificateErrors property also to the TSQLHttpClientWinHTTP class would be the best way to achieve the goal.
What do you think?
Offline
I've added TSQLHttpClientWinGeneric.IgnoreSSLCertificateErrors property to set the corresponding parameter for the underlying connection.
See http://synopse.info/fossil/info/94d6e38989
Thanks for the feedback!
Online
That's perfect. Thank you!
Offline