Al-Muhandis / fp-telegram

Telegram bots in Lazarus (and FreePascal)
MIT License
77 stars 16 forks source link

Identifier not found "stTLSv1_1" #1 #1

Closed JacoFourie closed 5 years ago

JacoFourie commented 5 years ago

Hi. I want to test the library on Raspberry Pi. I get this error when I compile the package. If I comment it out it compiles but I am not sure what will break if that is not there.

image

Al-Muhandis commented 5 years ago

Hi! You can try to comment this. But can you specify more details: Lazarus and FPC version, OS and CPU target etc?

JacoFourie commented 5 years ago

Hi, If I comment it out it compiles and runs but when it runs I get SSL errors.

I tried the project on Windows and there it works 100%. I then tried it on The Raspbarian Desktop in a virtual machine. There I get the same error that the variable does not exist.

I then tried it on Debian Desktop. There it compiles but I get SSL error also.

On Raspberry Pi I use it on Raspbian Buster (Debian 10) and FPC is 3.3.1 and Lazarus is 2.0.1

JacoFourie commented 5 years ago

Here I comment it out

image

Then I get the SSL error.

image

JacoFourie commented 5 years ago

If you don't have a Raspberry Pi you can download the Desktop and run it in a VM

https://www.raspberrypi.org/downloads/raspberry-pi-desktop/

Al-Muhandis commented 5 years ago

I meant to comment out the whole procedure.

procedure TTelegramSender.HttpClientGetSocketHandler(Sender: TObject;
  const UseSSL: Boolean; out AHandler: TSocketHandler);
begin
  {$IFDEF LINUX}
    //if UseSSL then begin
    //  AHandler:=TSSLSocketHandler.Create;
    //  TSSLSocketHandler(AHandler).SSLType:=stTLSv1_1;  // <--
    //end;
  {$ENDIF}
end;  
JacoFourie commented 5 years ago

Nope. Still get a SSL error.

Error: [HTTPPostJSON] ESSLSocketError: No SSL Socket support compiled in. Please include opensslsockets unit in program and recompile it.

Al-Muhandis commented 5 years ago

@JacoFourie please try last commit

JacoFourie commented 5 years ago

@Al-Muhandis I get the same error with the commit from 7 hours ago.

Error: [HTTPPostJSON] ESSLSocketError: No SSL Socket support compiled in. Please include opensslsockets unit in program and recompile it.

It wants SSL but can not find it.

Al-Muhandis commented 5 years ago

@JacoFourie Are you sure you tried the latest commit https://github.com/Al-Muhandis/fp-telegram/commit/4154e00da2a204420974f0f2ecaa89050a412ba6 / https://github.com/Al-Muhandis/fp-telegram ?

JacoFourie commented 5 years ago

Yes

image

Al-Muhandis commented 5 years ago

@JacoFourie Did you tried to add opensslsockets unit in tgsendertypes.pas ?

implementation

uses
  jsonparser, jsonscanner{$IFDEF ExplSSL}, sslsockets, fpopenssl{$ENDIF}, opensslsockets
  ;