Forum > Networking and Web Programming

TFPHTTPClient : ESSL failed to create SSL context

(1/2) > >>

Basile-B:
I'm on Fedora 27 with libopenssl / libcrypto at 1.1.0g, Laz 1.6.4, FPC 3.0.2. A simple request gives the error "ESSL, Failed to create SSL context". I suspect that the versions the loader use to load the libraries are not up to date, see

https://github.com/graemeg/freepascal/blob/master/packages/openssl/src/openssl.pas#L112

Just
--- Code: Pascal  window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program Project1; uses fphttpclient; procedure test;var  cli: TFPHTTPClient = nil;begin  cli := TFPHTTPClient.Create(nil);  try    cli.AddHeader('User-Agent','Mozilla/5.0 (compatible; fpweb)');    cli.Get('https://api.github.com/users/defunkt');  finally    cli.free;  end;end; begin  test();end.
is enough to get the error. The same kind of request worked fine when i made the feature using another distribution (although once done i didn't use the feature so it could be broken too for months).

What can i do ?

Basile-B:
And don't tell me "use wget / curl" please  ;D

Basile-B:
After modification of the version string the same error is still raised. I suspect an API breakage from 1.0.X to 1.1.X. Can anyone run the sample above with SSL 1.1 (1.1.0f or 1.1.0g) ?

eolandro:
Did you find answer? i'm stuck in the same error.

Leledumbo:
Working for me, but I have both 1.0.2.p and 1.1.0.i installed.

--- Code: ---$ cat a.pas
uses fphttpclient;
 
procedure test;
var
  cli: TFPHTTPClient = nil;
begin
  cli := TFPHTTPClient.Create(nil);
  try
    cli.AddHeader('User-Agent','Mozilla/5.0 (compatible; fpweb)');
    cli.Get('https://api.github.com/users/defunkt');
  finally
    cli.free;
  end;
end;
 
begin
  test();
end.

$ fpc -S2 a.pas
Hint: End of reading config file /etc/fpc.cfg
Target OS: Linux for x86-64
Compiling a.pas
Linking a
a.pas(18,1) Warning: "crtbegin.o" not found, this will probably cause a linking failure
a.pas(18,1) Warning: "crtend.o" not found, this will probably cause a linking failure
19 lines compiled, 0.4 sec
2 warning(s) issued
1 hint(s) issued

$ ./a
{"login":"defunkt","id":2,"node_id":"MDQ6VXNlcjI=","avatar_url":"https://avatars0.githubusercontent.com/u/2?v=4","gravatar_id":"","url":"https://api.github.com/users/defunkt","html_url":"https://github.com/defunkt","followers_url":"https://api.github.com/users/defunkt/followers","following_url":"https://api.github.com/users/defunkt/following{/other_user}","gists_url":"https://api.github.com/users/defunkt/gists{/gist_id}","starred_url":"https://api.github.com/users/defunkt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/defunkt/subscriptions","organizations_url":"https://api.github.com/users/defunkt/orgs","repos_url":"https://api.github.com/users/defunkt/repos","events_url":"https://api.github.com/users/defunkt/events{/privacy}","received_events_url":"https://api.github.com/users/defunkt/received_events","type":"User","site_admin":true,"name":"Chris Wanstrath","company":"@github ","blog":"http://chriswanstrath.com/","location":"San Francisco","email":null,"hireable":null,"bio":"🍔 ","public_repos":107,"public_gists":273,"followers":20407,"following":210,"created_at":"2007-10-20T05:24:19Z","updated_at":"2018-08-15T02:05:37Z"}

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version