Recent

Author Topic: HTTPS with Synapse on Mac  (Read 37859 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: HTTPS with Synapse on Mac
« Reply #30 on: July 01, 2015, 06:27:30 am »
Quote
When I edit code next , I get empty file:
I don't know how compatible ssl_openssl unit on Windows, but one thing for sure: https://google.com returns 302 Found (redirect response), not 200 OK with content, so you have to handle that redirect instead.

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: HTTPS with Synapse on Mac
« Reply #31 on: July 01, 2015, 07:21:54 am »
Quote
When I edit code next , I get empty file:
I don't know how compatible ssl_openssl unit on Windows, but one thing for sure: https://google.com returns 302 Found (redirect response), not 200 OK with content, so you have to handle that redirect instead.

I have traced code. No sending is made. I see in OllyDBG  WS2_32.connect call which return 0 (success). Then lazarus call FSock.SSLDoConnect; which return error.  . Application stops on this step.

It contain hard-coded error 'SSL/TLS support is not compiled!' . I have no idea, how synapse works on you PC. It's miracle.
« Last Edit: July 01, 2015, 07:36:45 am by anna »
WinXP SP3 Pro Russian 32-bit (5.1.2600)

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: HTTPS with Synapse on Mac
« Reply #32 on: July 01, 2015, 07:27:57 am »
When I change function like next, I see non-encrypted http GET request on 443 port by TCP protocol. I think it is not correct, as browser uses TLS protocol over TCP protocol. Browser makes Client Hello. Synapse does not. I think that synapse has absolutely wrong  interpretation of standard.
Code: [Select]
function THTTPSend.InternalDoConnect(needssl: Boolean): Boolean;
begin
  Result := False;
  FSock.CloseSocket;
  FSock.Bind(FIPInterface, cAnyPort);
  if FSock.LastError <> 0 then
    Exit;
  FSock.Connect(FTargetHost, FTargetPort);
  if FSock.LastError <> 0 then
    Exit;
  if needssl then
  begin
    if (FSock.SSL.SNIHost='') then
      FSock.SSL.SNIHost:=FTargetHost;
    sleep(1);// marker for debugging in OllyDBG
    FSock.SSLDoConnect;
    sleep(2);
    FSock.SSL.SNIHost:=''; //don't need it anymore and don't wan't to reuse it in next connection
    {if FSock.LastError <> 0 then
      Exit;    }
  end;
  FAliveHost := FTargetHost;
  FAlivePort := FTargetPort;
  Result := True;
end;     
« Last Edit: July 01, 2015, 07:38:53 am by anna »
WinXP SP3 Pro Russian 32-bit (5.1.2600)

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: HTTPS with Synapse on Mac
« Reply #33 on: July 01, 2015, 07:48:38 am »
Yep. It's my fault. SSLEAY32.dll and LIBEAY32.dll must be put in project folder.
WinXP SP3 Pro Russian 32-bit (5.1.2600)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: HTTPS with Synapse on Mac
« Reply #34 on: July 01, 2015, 01:44:42 pm »
Well, last year you didn't like the fact that you've to have .dlls out there. That's why I asked if you are still interested in static linking it.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: HTTPS with Synapse on Mac
« Reply #35 on: July 01, 2015, 01:46:18 pm »
I don't know how compatible ssl_openssl unit on Windows, but one thing for sure: https://google.com returns 302 Found (redirect response), not 200 OK with content, so you have to handle that redirect instead.
It's compatible. The only trick is to have external openssl libraries available. They're available by default in OSX, but has to be installed for Windows.
Btw, for google testing https://www.google.com should be used.

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: HTTPS with Synapse on Mac
« Reply #36 on: July 01, 2015, 06:08:32 pm »
Well, last year you didn't like the fact that you've to have .dlls out there. That's why I asked if you are still interested in static linking it.

Yes . Single file is 1000 % better then myriad of DLLs . Do you have a simple PAS-file which can be included to project? Give it to me, please.
WinXP SP3 Pro Russian 32-bit (5.1.2600)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: HTTPS with Synapse on Mac
« Reply #37 on: July 01, 2015, 06:59:13 pm »
I don't have the file, but I certainly know it's possible, as shown in this thead

Daniel Simoes

  • New Member
  • *
  • Posts: 10
    • DJSystem
Re: HTTPS with Synapse on Mac
« Reply #38 on: January 07, 2017, 12:25:52 am »
I see that the problem is not resolved in the latest svn snapshot (from february 2013) so i will attach the modified ssfpc.inc file for others to use.

ludob and mdalacu,

Thanks for your fix in ssfpc.inc, it works like a charm...

 

TinyPortal © 2005-2018