简体   繁体   中英

Delphi XE2 FireMonkey and ssl

does anyone know how to use ssl with Indy and get it to run under windowns and osX? I've seen the link below so TIdHttp appears to work but I need the ssl options.

Firemonkey and TDownloadUrl

Thanks

If you are using the Indy components that came with XE2, then you can drop in the Windows SSL binaries from OpenSSL. For Windows, put these in the same folder as your EXE:

  • libeay32.dll
  • ssleay32.dll

You'll find a link to the latest Windows binaries here:

http://www.openssl.org/related/binaries.html

You don't need Visual C++ 2088 redistributables if you are just using the DLLs, so ignore the installation warning if you get one.

Then, you add a TIdSSLIOHandleSocketOpenSSL component to your form. Set the IOHnandler property of your TIdHTTP component to the new TIdSSLIOHandlerSocketOpenSSL component.

Set the following SSLOptions of the TIdSSLIOHandlerSocketOpenSSL component:

Mode := sslmClient;

That's all you need. Now when you call a 'https://' instead of a 'http://' URL, it will automatically load the libraries and use the SSL component.

For OS X, it comes with OpenSSL, though not the latest versions, so you don't need to add any DLLs/dylibs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM