Recent

Author Topic: Download JSon from secure sites  (Read 3099 times)

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Download JSon from secure sites
« on: March 23, 2018, 06:00:13 pm »
Hi, a site like this one
https://jsonplaceholder.typicode.com/users

Can't be downloaded with this code

Code: Pascal  [Select][+][-]
  1. var
  2.   client: TFPHTTPClient;
  3. begin
  4.   try
  5.     client := TFPHttpClient.Create(nil);
  6.     client.AddHeader('Accept', 'application/json');
  7.     client.Get('https://jsonplaceholder.typicode.com/users');
  8.   finally
  9.     client.Free;
  10.   end;

I already have ssleay and libeay in the binary folder. I'm on Windows.

I get:
Connect to "siteurl":443 failed

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Download JSon from secure sites
« Reply #1 on: March 23, 2018, 06:58:21 pm »
I get:
Connect to "siteurl":443 failed

Your OpenSSL libs are probably too old.

The first thing I do with a problem site is analyze it here:

https://www.ssllabs.com/

It simulates calls from various browsers, etc. I see that your server fails with version 0.9.8y of OpenSSL. That's probably what you're using.


lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Download JSon from secure sites
« Reply #2 on: March 23, 2018, 07:02:53 pm »
I get:
Connect to "siteurl":443 failed

Your OpenSSL libs are probably too old.

The first thing I do with a problem site is analyze it here:

https://www.ssllabs.com/

It simulates calls from various browsers, etc. I see that your server fails with version 0.9.8y of OpenSSL. That's probably what you're using.

You're right. I replaced the SSL library I was using to the one that uses Lazarus (for Online Package Manager) and works fine.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Download JSon from secure sites
« Reply #3 on: March 23, 2018, 07:04:34 pm »
You're right. I replaced the SSL library I was using to the one that uses Lazarus (for Online Package Manager) and works fine.

Forgot to mention. You can get up to date libs zipped here:

http://indy.fulgan.com/SSL


lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Download JSon from secure sites
« Reply #4 on: March 23, 2018, 07:05:46 pm »
Many thanks. I will download from there.

 

TinyPortal © 2005-2018