Is it possible to send HTTPS posts in Delphi using Indy?

207 Views Asked by At

Is it possible to do https post requests in delphi? I tried a few tricks from the web to no avail. I have no experience in this area other than assembling a WSN using indy and delphi a few years ago (using tcp and udp binary packets).

mtxt:=TStringStream.Create('{some text here}',TEncoding.UTF8);
mhttp:=TIdHTTP.create(nil);
mIOHandler:=TIdSSLIOHandlerSocketOpenSSL.Create(nil);
mIOHandler.SSLOptions.SSLVersions:=[sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2,sslvSSLv2,sslvSSLv23];
mIOHandler.SSLOptions.Method:=sslvTLSv1_2; // no use of any other; firefox reports the site uses this one
mhttp.request.ContentType:='application/json';
mhttp.IOHandler:=mIOHandler;
mhttp.HandleRedirects:=true;
result:=mhttp.post('https://url here',mtxt); 

Tidhttp is 10.6.something. Tried two sets of *eay32 DLL's from two sources. Varied a few more parameters than in the code above (probably irrelevant). All variations of the ssloptions.method produce errors, first three giving the same error message and the other two different ones. Unfortunately googling these messages leads to vain cries for help and/or fixes that don't work. Any help is appreciated.

0

There are 0 best solutions below