FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xHB TipClientHTTP( ) substitute ?
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 08:36 AM

I get the same error using xHarbour. Unfortunately, the https protocol is not supported by tip.lib.

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 08:37 AM
TimStone wrote:Computers need to rattle our cages.


Can you explain this phrase, please? :-)

EMG
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 02:21 PM

Enrico,

Using xHarbour.com I have no problem with this class. My older version has been executing it,. as written, just fine. Its the Harbour with MSVC that is having a problem.

When I look at the harbor source code, it would appear that https IS supported.

That little line about computers is "humor". It means that when a computer has the opportunity, it will make problems for us ! "Rattle our cages" means that something, or someone, likes to do something we don't want, or expect.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 02:36 PM
TimStone wrote:Using xHarbour.com I have no problem with this class.


This only mean that xHarbour.com has implemented https protocol support. Official xHarbour has not. :-)

TimStone wrote:That little line about computers is "humor". It means that when a computer has the opportunity, it will make problems for us ! "Rattle our cages" means that something, or someone, likes to do something we don't want, or expect.


Thank you! :-)

EMG
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 02:45 PM

I'm using an older version of xHarbour.com.

I have two builds of my primary application. One is with the older xHarbour and the other with MSVC 2010 / Harbour. We have resolved every problem with the new one except this issue.

I can certainly consider an alternative, but I don't see there is one.

Any suggestions would be greatly appreciated. I cannot distribute these newer applications until I can get this xml interaction working.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 02:49 PM

Sorry, I don't use Harbour.

EMG

Posts: 207
Joined: Fri Oct 07, 2005 07:58 AM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 03:08 PM
Maybe you can use Wininet or WinHTTP API:
http://www.codeproject.com/Articles/389 ... ing-Winine
http://www.codeproject.com/Articles/666 ... apper-in-C

TimStone wrote:I'm using an older version of xHarbour.com.

I have two builds of my primary application. One is with the older xHarbour and the other with MSVC 2010 / Harbour. We have resolved every problem with the new one except this issue.

I can certainly consider an alternative, but I don't see there is one.

Any suggestions would be greatly appreciated. I cannot distribute these newer applications until I can get this xml interaction working.

Tim
© I'm not patented!
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 03:50 PM
You might try to adapt the function below to your needs. It is based on a sample from Harbour SVN.

Code (fw): Select all Collapse
FUNCTION Test
LOCAL socket, ssl_ctx, buffer, tmp, ssl

hb_inetInit()

socket := hb_inetCreate()
hb_inetTimeout( socket, 2500 )
hb_inetConnect( "www.fortify.net", 443, socket )

IF hb_inetErrorCode( socket ) = 0
    SSL_INIT()
    ssl_ctx := SSL_CTX_NEW()
    ssl := SSL_NEW( ssl_ctx )

    hb_inetFD( socket )
    SSL_SET_FD( ssl, hb_inetFD( socket ) )
    tmp := SSL_CONNECT( ssl )
    IF SSL_GET_ERROR( ssl, tmp ) = 0 // Everything OK
        tmp := SSL_WRITE( ssl, "GET / http/1.1" + CRLF + "Host: " + "www.fortify.net" + CRLF + CRLF )
        IF SSL_GET_ERROR( ssl, tmp ) = 0  // Everything OK
           buffer := Space( 1024 )
           tmp := SSL_READ( ssl, @buffer )
           IF SSL_GET_ERROR( ssl, tmp ) = 0  // Everything OK
            msginfo( buffer )
           ENDIF
        ELSE
            msgStop( "SSL_WRITE ERROR" )
        ENDIF   
    ELSE
        msgStop( "SSL_CONNECT ERROR" )
    ENDIF   
    hb_inetClose( socket )
ELSE
    msgStop( "UNABLE TO CONNECT!" )
ENDIF


I linked ssleay32 libeay32 hbssl
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 04:31 PM
Hi Tim,

It´s working now, at least I can browse the oHttp object. Download the updated libs from ftp://dutheil.dyndns-server.com/libs.zip

Code (fw): Select all Collapse
FUNCTION Test2
LOCAL oHttp := TIpClientHTTP():new( "https://www.fortify.net",  .F.  ) 
 IF .NOT. oHttp:open() // Open the connection
    MsgAlert(  "Connection error:", oHttp:lastErrorMessage( )  )
 ELSE
    XBROWSE( oHttp )
 ENDIF
RETURN ( NIL )
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Thu Oct 18, 2012 06:18 PM

Could you email me your make file section with the libs you are including, and in what order. I'm wondering if I have a conflict.

"TimStone@MasterLinkSoftware.com"

Thanks

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Sat Oct 20, 2012 12:22 AM

Thanks to Andre who revised the libraries and they now work !

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Sat Oct 20, 2012 07:11 AM

Great! Can I have the new lib? I would try it with xHarbour but the link is not working anymore.

EMG

Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Sat Oct 20, 2012 12:18 PM
Libs are available at: https://www.box.com/s/6sm1zzxuwvlwokji6nos

They were built from HARBOUR svn:

Harbour Build Info
---------------------------
Version: Harbour 3.2.0dev (Rev. 18349)
Compiler: Microsoft Visual C++ 16.0.30319 (32-bit)
Platform: Windows 7 6.1.7601 Service Pack 1
PCode version: 0.3
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Sat Oct 20, 2012 12:32 PM

Sorry, can I have the source code, please?

EMG

Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: xHB TipClientHTTP( ) substitute ?
Posted: Sat Oct 20, 2012 01:20 PM
You can download the source from:

https://www.box.com/s/onitle3ibdp6z66e15z0

They came from HARBOUR svn. My ENV vars are:
Code (fw): Select all Collapse
SET HB_TIP_OPENSSL=yes
SET HB_HAS_OPENSSL=yes
SET HB_STATIC_OPENSSL=yes
SET HB_WITH_CURL=e:\libcurl-7.19.3-win32-ssl-msvc\include
SET HB_WITH_OPENSSL=E:\OpenSSL-Win32\include\

I built the hbtipssl lib running hbmk2 inside the hbtip directory with para -IYourSourceDirectory\hbssl
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10