Synapse - HTTPS lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- anna · 2014-02-14 09:15 When I convert httpsserv demo , I see TTimeZoneInformation (and other time-functions) errors: Options changed, recompiling clean with -B I:\synapse39\source\lib\synafpc.pas(74,28) Hint: Parameter "Module" not used I:\synapse39\source\lib\synafpc.pas(74,48) Hint: Parameter "Buffer" not used I:\synapse39\source\lib\synafpc.pas(74,63) Hint: Parameter "BufLen" not used I:\synapse39\source\lib\sswin32.pas(1195,20) Hint: Local variable "Hints1" does not seem to be initialized I:\synapse39\source\lib\sswin32.pas(1196,20) Hint: Local variable "Hints2" does not seem to be initialized I:\synapse39\source\lib\sswin32.pas(1221,40) Hint: Local variable "Sin1" does not seem to be initialized I:\synapse39\source\lib\sswin32.pas(1227,44) Hint: Local variable "Sin2" does not seem to be initialized I:\synapse39\source\lib\sswin32.pas(1321,21) Hint: Local variable "Hints" does not seem to be initialized I:\synapse39\source\lib\sswin32.pas(1389,21) Hint: Local variable "Hints" does not seem to be initialized I:\synapse39\source\lib\sswin32.pas(1439,21) Hint: Local variable "Hints" does not seem to be initialized I:\synapse39\source\lib\synautil.pas(367,33) Error: Identifier not found "TTimeZoneInformation" I:\synapse39\source\lib\synautil.pas(367,33) Error: Error in type definition I:\synapse39\source\lib\synautil.pas(370,30) Error: Identifier not found "GetTimeZoneInformation" I:\synapse39\source\lib\synautil.pas(371,6) Error: Constant and CASE types do not match I:\synapse39\source\lib\synautil.pas(372,24) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(372,40) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(373,6) Error: Constant and CASE types do not match I:\synapse39\source\lib\synautil.pas(374,24) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(374,40) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(376,22) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(564,51) Warning: Symbol "TimeSeparator" is deprecated I:\synapse39\source\lib\synautil.pas(634,27) Hint: Local variable "x" does not seem to be initialized I:\synapse39\source\lib\synautil.pas(713,15) Error: Identifier not found "Windows" I:\synapse39\source\lib\synautil.pas(713,27) Error: Error in type definition I:\synapse39\source\lib\synautil.pas(715,16) Error: Identifier not found "GetSystemTime" I:\synapse39\source\lib\synautil.pas(716,18) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(717,19) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(718,17) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(719,18) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(720,20) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(721,20) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(722,25) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(755,15) Error: Identifier not found "Windows" I:\synapse39\source\lib\synautil.pas(755,27) Error: Error in type definition I:\synapse39\source\lib\synautil.pas(758,7) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(759,7) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(760,7) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(761,7) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(762,7) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(763,7) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(764,7) Error: Illegal qualifier I:\synapse39\source\lib\synautil.pas(765,26) Error: Identifier not found "SetSystemTime" I:\synapse39\source\lib\synautil.pas(809,28) Error: Identifier not found "TLargeInteger" I:\synapse39\source\lib\synautil.pas(809,28) Error: Error in type definition I:\synapse39\source\lib\synautil.pas(814,13) Error: Identifier not found "Windows" I:\synapse39\source\lib\synautil.pas(816,12) Error: Identifier not found "Windows" I:\synapse39\source\lib\synautil.pas(821,22) Warning: Local variable "tick" does not seem to be initialized I:\synapse39\source\lib\synautil.pas(821,29) Warning: Local variable "freq" does not seem to be initialized I:\synapse39\source\lib\synautil.pas(825,22) Error: Identifier not found "Windows" I:\synapse39\source\lib\synautil.pas(1804,43) Warning: Symbol "ShortMonthNames" is deprecated I:\synapse39\source\lib\synautil.pas(1805,42) Warning: Symbol "ShortMonthNames" is deprecated I:\synapse39\source\lib\synautil.pas(1808) Fatal: There were 35 errors compiling module, stopping ---------------------------------------------------------------------- anna · 2014-02-14 09:18 TTimeZoneInformation, GetTimeZoneInformation is situated in SysUtils unit. SysUtils is present in USES-section. So why lazarus does not get declaration from SysUtils??? I use ftp://freepascal.dfmk.hu/pub/lazarus/snapshots/Lazarus-1.3- 44035-fpc-2.6.2-20140213-win32.exe ---------------------------------------------------------------------- anna · 2014-02-14 10:01 I actually need a some like http demo, but for https - sites. I rewrite button1.click routine of http-demo: Code: [Select]unit Unit1; {$MODE Delphi} interface uses ssl_openssl, LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, httpsend, StdCtrls, ExtCtrls; // ... procedure TForm1.Button1Click(Sender: TObject); var HTTP: THTTPSend; begin HTTP := THTTPSend.Create; try HTTP.Sock.CreateWithSSL(TSSLOpenSSL); HTTP.Sock.SSLDoConnect; HTTP.ProxyHost := Edit8.Text; HTTP.ProxyPort := Edit9.Text; HTTP.HTTPMethod('GET', Edit1.text); Memo1.Lines.Assign(HTTP.Headers); Memo2.Lines.LoadFromStream(HTTP.Document); finally HTTP.Free; end; end; but in sniffer I see nothing and on project form too. How to make https-get-request correctly with synapse ? For example how to get html-code of page https://www.google.com.ua/ , which I see in real browser? ---------------------------------------------------------------------- anna · 2014-02-14 11:33 Oh, I see. When I put ssleay32.dll and libeay32.dll to executable folder, i finally see html-source of page. But I take this DLLs from another application, and I have not found libssl32.dll. So from where I must download these DLLs? What version of DLLs must be? I've found DLLs on site http://www.openssl.org/related/binaries.html >> http://slproweb.com/download/Win32OpenSSL_Light-1_0_1f.exe But it is installer , so I do not like to install some thing in windows-registry just for getting 3 DLLs. ---------------------------------------------------------------------- taazz · 2014-02-14 12:54 A quick check reveled that the setup was build with inno setup and the best utility to unpack is as far as I know is innounp http://innounp.sourceforge.net/. Use it to get the dlls out of the setup and the script on what it is installed where. ---------------------------------------------------------------------- jarto · 2014-02-14 14:09 OpenSSL dlls are available here: http://indy.fulgan.com/SSL/ ---------------------------------------------------------------------- anna · 2014-02-14 18:50 For what purpose libssl32.dll is needed? Is libssl32.dll obligatory? Why my application works without libssl32.dll? Is there a way to send get -request by 443-port (HTTPS) without external DLLs? ---------------------------------------------------------------------- skalogryz · 2014-02-14 20:07 Quote from: anna on February 14, 2014, 07:50:37 pmFor what purpose libssl32.dll is needed? Is libssl32.dll obligatory? Why my application works without libssl32.dll? Is there a way to send get -request by 443-port (HTTPS) without external DLLs? These are OpenSSL libraries. They're used to for HTTPS implementation, since all the encryption and validation code is within these two libraries. You shouldn't have to "install" these libraries to Windows registry, just keep them with the application. ---------------------------------------------------------------------- anna · 2014-02-15 09:11 Quote from: skalogryz on February 14, 2014, 09:07:42 pmQuote from: anna on February 14, 2014, 07:50:37 pmFor what purpose libssl32.dll is needed? Is libssl32.dll obligatory? Why my application works without libssl32.dll? Is there a way to send get -request by 443-port (HTTPS) without external DLLs? These are OpenSSL libraries. They're used to for HTTPS implementation, since all the encryption and validation code is within these two libraries. You shouldn't have to "install" these libraries to Windows registry, just keep them with the application. I hate application with heaps of DLLs. I love application of single executable. So it's imposible to put some openssl source-code in some unit of application, is not it? I must to put this DLLs to executable resources to achieve my aim, must not I? ---------------------------------------------------------------------- jarto · 2014-02-15 12:43 If you use OpenSSL, then you need to live with those two DLL-files. If you want to get rid of the DLLs, then check out SecureBlackBox. Synapse has support for it too. I haven't myself tried it, though. ---------------------------------------------------------------------- skalogryz · 2014-02-15 15:06 Quote from: anna on February 15, 2014, 10:11:02 amI hate application with heaps of DLLs. I love application of single executable. So it's imposible to put some openssl source-code in some unit of application, is not it? I must to put this DLLs to executable resources to achieve my aim, must not I? Your application is a heap of .dlls already. Though this heap of dlls reside at Windows system directories. If possible, install dlls there. Otherwise you can definitely use pascal native encryption - as suggested by jarto. SecureBlackBox is commercially licensed component, so it might be necessary to pay for it. Another approach is to use OpenSSL as a static library. You'd need to do two things. 1) compile OpenSSL to get object files (.o) rather than dynamic library (.dll) 2) modify ssl_openssl_lib.pas of synapse library to be able to use to these object files. That's it. You'll have OpenSSL statically linked to your application. No external dlls needed. ---------------------------------------------------------------------- anna · 2014-02-15 18:08 Thanks for help. Another problem I hit is how to make HTTPS-POST- request ? I need register on some site. Next code does not work: Code: [Select] URLData:='_username=test&_password=password&_remembe r_me=on&_submit=%C2%EE%E9%F2%E8; s_oldmime:=http.MimeType; HTTP.ProxyHost := ''; HTTP.ProxyPort := ''; HTTP.Document.Write(Pointer(URLData)^, Length(URLData)); HTTP.MimeType := 'application/x-www-form-urlencoded'; HTTP.HTTPMethod('POST', 'https://***'); ---------------------------------------------------------------------- skalogryz · 2014-02-15 18:14 if your URLData is type of String (or AnisString) try this Code: [Select] URLData:='_username=test&_password=password&_remembe r_me=on&_submit=%C2%EE%E9%F2%E8; s_oldmime:=http.MimeType; HTTP.ProxyHost := ''; HTTP.ProxyPort := ''; HTTP.Document.Write(URLData[1], Length(URLData)); HTTP.MimeType := 'application/x-www-form-urlencoded'; HTTP.HTTPMethod('POST', 'https://***'); In general Synapse has a nice Monitor method to see what is actually being sent. Very useful for debugging. Code: [Select] procedure TDebugObject.Monitor(Sender: TObject; Writing: Boolean; const Buffer: TMemory; Len: Integer); var s : string; begin if Len>0 then begin SetLength(s, Len); Move(Buffer^, s[1], len); write(s); end; end; Http.Sock.OnMonitor:=debug.Monitor ---------------------------------------------------------------------- anna · 2014-02-15 18:25 Quote from: skalogryz on February 15, 2014, 07:14:52 pmif your URLData is type of String (or AnisString) try this Code: [Select] URLData:='_username=test&_password=password&_remembe r_me=on&_submit=%C2%EE%E9%F2%E8; s_oldmime:=http.MimeType; HTTP.ProxyHost := ''; HTTP.ProxyPort := ''; HTTP.Document.Write(URLData[1], Length(URLData)); HTTP.MimeType := 'application/x-www-form-urlencoded'; HTTP.HTTPMethod('POST', 'https://***'); ... [/code] Not helped. I am still not logined in on site. In sniffer (but in sniffer all is already encrypted) I see some message "Encrypted Alert": Code: [Select] TLS:TLS Rec Layer-1 HandShake: Client Hello. TLS:TLS Rec Layer-1 HandShake: Server Hello.; TLS Rec Layer-2 HandShake: Certificate. TLS:Continued Data: 141 Bytes TLS:TLS Rec Layer-1 HandShake: Client Key Exchange.; TLS Rec Layer-2 Cipher Change Spec; TLS Rec Layer-3 HandShake: Encrypted Handshake Message. TLS:TLS Rec Layer-1 HandShake: Encrypted Handshake Message.; TLS Rec Layer-2 Cipher Change Spec; TLS Rec Layer-3 HandShake: Encrypted Handshake Message. TLS:TLS Rec Layer-1 SSL Application Data; TLS Rec Layer-2 SSL Application Data TLS:TLS Rec Layer-1 SSL Application Data TLS:TLS Rec Layer-1 Encrypted Alert ---------------------------------------------------------------------- skalogryz · 2014-02-15 19:26 What's the HTTP server response you're getting (the text/code)? Or are you not getting any HTTP response? ---------------------------------------------------------------------- anna · 2014-02-16 03:38 The site is raketa-tv.com . First I make fake registration login = AzarovUvolen@yandex.ru pass = AzarovUvoleo The form html is like this: Code: [Select]
I have written next code. First to know _csrf_token I download logon- page, search _csrf_token and parse next quote-marks (value). The search procedure is in another modules (finddlgunit, obsfilter) so code will be not working on you computer, but this enough to understand what I do... Then I generate a POST request with right _csrf_token. Code: [Select]procedure RaketaTVPlaylist_TlBtnClick_unit22PHANTOME2; var HTTP: THTTPSend; var tmParsedPosNumbers:TMemo; lPos0:longint; s_csrf_token:string; const Separators: TSysCharSet=[';']; WhiteSpace: TSysCharSet=[]; var bmax_csrf_tokenlen, i2_RaketaTVPlaylist_TlBtnClick_unit22PHANTOME2:byte; i_RaketaTVPlaylist_TlBtnClick_unit22PHANTOME2:integer; buf_RaketaTVPlaylist_TlBtnClick_unit22PHANTOME2 : array[1..65535] of char; f_raketaloginHTM:file; URLData, s_oldmime: string; b_qoute_countr:byte; pdw:pdword; dw:dword; begin HTTP := THTTPSend.Create; try HTTP.Sock.CreateWithSSL(TSSLOpenSSL); HTTP.Sock.SSLDoConnect; HTTP.ProxyHost := ''; HTTP.ProxyPort := ''; HTTP.HTTPMethod('GET', 'https://raketa-tv.com/connect'); HTTP.Document.SaveToFile('~raketalogin.htm'); {----------------------------------------} finddlgunit.FindDlg.edit1.text:=ExtractFilePath(paramstr(0))+'~rak etalogin.htm'; begin SetLength(obsfilter.Systems,1); begin obsfilter.Systems[0].FindName:='_csrf_token'; obsfilter.Systems[0].RealName:='bad word replacement'; end; obsfilter.Preprocess(); with obsfilter.FindSystem(finddlgunit.FindDlg.edit1.text) do try finddlgunit.FindDlg.memo1.text:=text; finally Free; end; obsfilter.Cleanup(); end; tmParsedPosNumbers:=TMemo.Create(nil); tmParsedPosNumbers.Text:=''; ExtractStrings(Separators, WhiteSpace, PChar(finddlgunit.FindDlg.memo1.Text), tmParsedPosNumbers.Lines);//CAREFUL!!!Lines[0] may overflow on Lines[1,2 etc.] if contain many numbers //CAREFUL!!! If nothing found .Text gives #10#13, not empty string // ExtractStrings(Separators, WhiteSpace, // PChar(FindDlg.memo1.Lines[0]), tmParsedPosNumbers.Lines); system.assign(f_raketaloginHTM,Utf8ToAnsi(finddlgunit.FindDlg.edit 1.text)); filemode := fmOpenRead; reset(f_raketaloginHTM,1); bmax_csrf_tokenlen:=43*3; // usually 43 characters plus length of value=" form1.wmpubPssC00001.lines.Clear; for i_RaketaTVPlaylist_TlBtnClick_unit22PHANTOME2:=1 to tmParsedPosNumbers.Lines.Count do begin // must be 1 iteration lpos0:=strtoint64(tmParsedPosNumbers.Lines[i_RaketaTVPlaylist_Tl BtnClick_unit22PHANTOME2-1]); Seek(f_raketaloginHTM,lpos0+11+1); //length('_csrf_token')=11 + quote BlockRead(f_raketaloginHTM,buf_RaketaTVPlaylist_TlBtnClick_unit2 2PHANTOME2,bmax_csrf_tokenlen,NumRead); s_csrf_token:=''; b_qoute_countr:=0; for i2_RaketaTVPlaylist_TlBtnClick_unit22PHANTOME2:=1 to bmax_csrf_tokenlen do begin if (buf_RaketaTVPlaylist_TlBtnClick_unit22PHA NTOME2[i2_RaketaTVPlaylist_TlBtnClick_unit22PHANTOME2]=#$22) or (buf_R aketaTVPlaylist_TlBtnClick_unit22PHANTOME2[i2_RaketaTVPlaylist_TlBtnCl ick_unit22PHANTOME2]=#$27) then begin inc(b_qoute_countr); continue; end; if (b_qoute_countr=1) then s_csrf_token:=s_csrf_token+(buf_RaketaTV Playlist_TlBtnClick_unit22PHANTOME2[i2_RaketaTVPlaylist_TlBtnClick_uni t22PHANTOME2]); if b_qoute_countr>1 then break; end; end; system.close(f_raketaloginHTM); tmParsedPosNumbers.Free; URLData:='_username=AzarovUvolen%40yandex.ru&_password=AzarovUvole o&_remember_me=on&_submit=%C2%EE%E9%F2%E8&_csrf_token=' + s_csrf_token; s_oldmime:=http.MimeType; HTTP.ProxyHost := ''; HTTP.ProxyPort := ''; HTTP.Document.Write(URLData[1], Length(URLData)); HTTP.MimeType := 'application/x-www-form-urlencoded'; HTTP.HTTPMethod('POST', 'https://raketa-tv.com/login_check'); sleep(11); pdw:=HTTP.Document.Memory; dw:= pdw^; sleep(12); HTTP.MimeType:=s_oldmime; HTTP.ProxyHost := ''; HTTP.ProxyPort := ''; HTTP.HTTPMethod('GET', 'http://raketa-tv.com/'); HTTP.Document.SaveToFile('~getauthorizedChannels.htm'); sleep(13); finally HTTP.Free; end; end; ---------------------------------------------------------------------- anna · 2014-02-16 03:55 Quote from: skalogryz on February 15, 2014, 08:26:03 pmWhat's the HTTP server response you're getting (the text/code)? Or are you not getting any HTTP response? I do not know , how to get server response. HTTP.Document.Memory gives something strange: Code: [Select] Redirecting to https://raketa-tv.com/connect. ---------------------------------------------------------------------- anna · 2014-02-16 07:58 I have debug my app in OllyDBG and found , that app uses ssleay32.SSL_write procedure with 3 parameters. One of them is non- encrypted data: Code: [Select]POST /login_check HTTP/1.0 Host: raketa-tv.com:443 Keep-Alive: 300 Connection: keep-alive Cookie: User-Agent: Mozilla/4.0 (compatible; Synapse) Content-Type: application/x-www-form-urlencoded Content-Length: 13338 HTTP/1.1 200 OK Server: nginx Date: Sun, 16 Feb 2014 07:53:15 GMT Content-Type: text/html; charset=UTF-8 Connection: close X-Powered-By: PHP/5.3.27 Set-Cookie: path=/ Cache-Control: no-cache _username=AzarovUvolen%40yandex.ru&_password=AzarovUvoleo&_remember_me =on&_submit=%C2%EE%E9%F2%E8&_csrf_token=888v6EmzUOn_Zr5LjCJKGpsSHv- 81M4a5HdT-bmCL-ocpJm3yqq1Lyc But debugging Opera Browser i see: Code: [Select]POST /login_check HTTP/1.1 User-Agent: Opera/9.50 (Nintendo DSi; Opera/446; U; ja) Host: raketa-tv.com Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 Accept-Language: ru-RU,ru;q=0.9,en;q=0.8 Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1 Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0 Referer: http://www.w3schools.com/tags/tryit_view.asp?x=0.7605253404472023 Cookie: Cookie2: $Version=1 Connection: Keep-Alive, TE TE: deflate, gzip, chunked, identity, trailers Content-Length: 153 Content-Type: application/x-www-form-urlencoded _username=AzarovUvolen%40yandex.ru&_password=AzarovUvoleo&_remember_me =on&_submit=%C2%EE%E9%F2%E8&_csrf_token=Eee6WWxfdg-QmpFWQWuJJ- QGCp5RMEKwcY3kA7FEsk4 ---------------------------------------------------------------------- anna · 2014-02-16 09:45 I think I've found what error was in. Synapse writes server responce of previous frame to HTTP.Document. I have tried HTTP.Document.Clear before using POST-request, but unsuccessful. Only when I rewrite code like next , all become good. Code: [Select]{...........................} s_cookie:=HTTP.Cookies.Text; HTTP.Free; HTTP := THTTPSend.Create; HTTP.Cookies.Text:=s_cookie; URLData:='_username=AzarovUvolen%40yandex.ru&_password=AzarovUvole o&_remember_me=on&_submit=%C2%EE%E9%F2%E8&_csrf_token=' + s_csrf_token; s_oldmime:=http.MimeType; HTTP.ProxyHost := ''; HTTP.ProxyPort := ''; HTTP.Document.Clear; HTTP.Document.Write(Pointer(URLData)^, Length(URLData)); HTTP.MimeType := 'application/x-www-form-urlencoded'; HTTP.HTTPMethod('POST', 'https://raketa-tv.com/login_check'); {...........................} ---------------------------------------------------------------------- skalogryz · 2014-02-16 13:34 you don't have to recreate the HTTP object to clear the Document. It should work the following way: Code: [Select] HTTP.Document.Position:=0; HTTP.Document.Write(Pointer(URLData)^, Length(URLData)); HTTP.Document.Size:=HTTP.Document.Position; // or HTTP.Document.SetSize( HTTP.Document.Position ); HTTP.MimeType := 'application/x-www-form-urlencoded'; HTTP.HTTPMethod('POST', 'https://raketa-tv.com/login_check'); ---------------------------------------------------------------------- anna · 2014-02-16 15:29 Quote from: skalogryz on February 16, 2014, 02:34:05 pmyou don't have to recreate the HTTP object to clear the Document. It should work the following way: Code: [Select] HTTP.Document.Position:=0; HTTP.Document.Write(Pointer(URLData)^, Length(URLData)); HTTP.Document.Size:=HTTP.Document.Position; // or HTTP.Document.SetSize( HTTP.Document.Position ); HTTP.MimeType := 'application/x-www-form-urlencoded'; HTTP.HTTPMethod('POST', 'https://raketa-tv.com/login_check'); Thank you. Does only POST- request add response from previous frame? What about GET-request? If I call 2 GET-requests one by one without cleaning HTTP.Document, will I get correct second response? Besides , when I debugged Opera browser, I don't see any open ssl libraries. So it is possible to write code. ---------------------------------------------------------------------- skalogryz · 2014-02-16 18:57 Quote from: anna on February 16, 2014, 04:29:26 pmThank you. Does only POST- request add response from previous frame? What about GET- request? If I call 2 GET-requests one by one without cleaning HTTP.Document, will I get correct second response? Typically GET method doesn't use Document, but cleaning it before calling HTTPMethod is a good practice. Quote from: anna on February 16, 2014, 04:29:26 pmBesides , when I debugged Opera browser, I don't see any open ssl libraries. So it is possible to write code. I don't understand what you mean here, but it is good, if it's working for you. ---------------------------------------------------------------------- anna · 2014-02-17 03:17 Quote from: skalogryz on February 16, 2014, 07:57:30 pm Quote from: anna on February 16, 2014, 04:29:26 pmBesides , when I debugged Opera browser, I don't see any open ssl libraries. So it is possible to write code. I don't understand what you mean here, but it is good, if it's working for you. Quote from: jarto on February 15, 2014, 01:43:45 pmIf you use OpenSSL, then you need to live with those two DLL-files. If you want to get rid of the DLLs, then check out SecureBlackBox. Synapse has support for it too. I haven't myself tried it, though. Opera programmers do not use SSLEAY32.dll and LIBEAY32.dll. ---------------------------------------------------------------------- skalogryz · 2014-02-17 03:53 Quote from: anna on February 17, 2014, 04:17:17 amOpera programmers do not use SSLEAY32.dll and LIBEAY32.dll. Ah... I presume they are not using Synapse as well... Maybe even worse, they're not using FPC... Synapse library allows flexibility in how SSL can be implemented: * OpenSSL (requires external dlls) * cryptlib (requires external dlls) * SecureBlackBox (native pascal, commercial license) * StreamSecII (native pascal, commercial license) You can add more yourself, but it requires you an understanding of how SSL works, how Synapse works and the back-end encryption library you're going to use. And there might be freeware or opensource pascal encryption libraries available. The choice is yours - you can use what has already been implemented (and debugged to some extent) - with some limitations such as a couple of dlls or price, if you choose a commercial encryption library. ---------------------------------------------------------------------- BeniBela · 2014-02-18 22:57 And then there are my internet tools. They do not need any additional dlls, because they use the dlls installed with Windows. Quote from: anna on February 16, 2014, 04:38:13 amI have written next code. First to know _csrf_token I download logon-page, search _csrf_token and parse next quote-marks (value). The search procedure is in another modules (finddlgunit, obsfilter) so code will be not working on you computer, but this enough to understand what I do... lol This should do the same: Code: [Select]uses simpleinternet, bbutils; begin httpRequest(process('https://raketa-tv.com/connect', 'form(//form, {"_username": "AzarovUvolen@yandex.ru", "_password": "AzarovUvoleo", "_remember_me": "on"})')); strSaveToFile('~getauthorizedChannels.htm', httpRequest('http://raketa-tv.com/')); end.