开发者

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 bel开发者_StackOverflowow 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜