In my code, I am doing this in the component's AfterConnect event.
Code: Select all
MySslClient.IsSecure := True;
try
RequestResult := MySslClient.WriteBuffer(ReqBuff, 0, Length(ReqBuff));
SetLength(RespBuff, 1024*1024);
Len := MySslClient.ReadBuffer(RespBuff, 0, Length(RespBuff));
if Len = 0 then
Raise('Zero length response from host');
SetLength(RespBuff, Len);
ResponseStr := ResponseStr + AsciiBytesToStr(RespBuff);
ShowMessage(ResponseStr);
finally
MySslClient.Disconnect;
end;
"The other side has sent a failure alert: [40]"
Why would this happen when we try to set IsSecure?
Thanks!