xHB TipClientHTTP( ) substitute ?

Re: xHB TipClientHTTP( ) substitute ?

Postby Enrico Maria Giordano » Thu Oct 18, 2012 8:36 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHB TipClientHTTP( ) substitute ?

Postby Enrico Maria Giordano » Thu Oct 18, 2012 8:37 am

TimStone wrote:Computers need to rattle our cages.


Can you explain this phrase, please? :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHB TipClientHTTP( ) substitute ?

Postby TimStone » Thu Oct 18, 2012 2: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: xHB TipClientHTTP( ) substitute ?

Postby Enrico Maria Giordano » Thu Oct 18, 2012 2: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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHB TipClientHTTP( ) substitute ?

Postby TimStone » Thu Oct 18, 2012 2: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Re: xHB TipClientHTTP( ) substitute ?

Postby modicr » Thu Oct 18, 2012 3: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!
User avatar
modicr
 
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia

Re: xHB TipClientHTTP( ) substitute ?

Postby ADutheil » Thu Oct 18, 2012 3:50 pm

You might try to adapt the function below to your needs. It is based on a sample from Harbour SVN.

Code: Select all  Expand view
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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: xHB TipClientHTTP( ) substitute ?

Postby ADutheil » Thu Oct 18, 2012 4: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: Select all  Expand view

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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: xHB TipClientHTTP( ) substitute ?

Postby TimStone » Thu Oct 18, 2012 6: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: xHB TipClientHTTP( ) substitute ?

Postby TimStone » 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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: xHB TipClientHTTP( ) substitute ?

Postby Enrico Maria Giordano » Sat Oct 20, 2012 7:11 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHB TipClientHTTP( ) substitute ?

Postby ADutheil » 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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: xHB TipClientHTTP( ) substitute ?

Postby Enrico Maria Giordano » Sat Oct 20, 2012 12:32 pm

Sorry, can I have the source code, please?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHB TipClientHTTP( ) substitute ?

Postby ADutheil » Sat Oct 20, 2012 1:20 pm

You can download the source from:

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

They came from HARBOUR svn. My ENV vars are:
Code: Select all  Expand view

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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 85 guests