Cant connect to https. Do I also need to re-build hbtip with OPENSSL?

196 views
Skip to first unread message

Reinaldo

unread,
Aug 19, 2018, 2:57:27 PM8/19/18
to Harbour Users
Hello everyone;

I built hbssl using OPENSSL ver 1.0.0g.

I'm linking this newly built hbssl.lib and OPENSSL libs with my app.   I'm able to test a few of the ssleay32.lib functions successfully which proves SSL libs are linked in.  But can not connect to https.   

Do I have to rebuild the original hbtip.lib now that I have hbssl created?  If so, how?  Is there an environmental variable I need to set before?

Here is an encapsulated reduced sample code that reproduces the problem.  BTW-- it executes fine on xHarbour:


//--------------- BOF ---------------//
Function Main() 
LOCAL oHttp

   hb_inetInit()
   SSL_init()

   ? SSLeay_version( HB_SSLEAY_VERSION  )
   ? SSLeay_Version( HB_SSLEAY_DIR ) 
   ? SSLeay_version( HB_SSLEAY_CFLAGS   ) 
   ? SSLeay_version( HB_SSLEAY_BUILT_ON ) 
   ? SSLeay_version( HB_SSLEAY_PLATFORM ) 
   ? SSLeay_version( HB_SSLEAY_DIR      )          // also **please take a look at the output for this line.***

   oHttp := tIPClientHTTP():new( cUrl, .T. )


RETURN NIL 
//--------------- EOF ---------------//



Here is the output:
F:\Mp10\Services>testssl

OpenSSL 1.0.0g 18 Jan 2012
OPENSSLDIR: "/usr/local/ssl"
compiler: cl -D_USE_32BIT_TIME_T  /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS  -DDSO_WIN3
2 -D_USE_32BIT_TIME_T -W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN
32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_BN_ASM_PART_WOR
DS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_AS
M -DMD5_ASM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM -DOPENSSL_USE_APPLINK -I. -DO
PENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO
_STATIC_ENGINE
built on: Fri Jan 20 02:17:57 2012
platform: VC-WIN32
OPENSSLDIR: "/usr/local/ssl"
Error BASE/1081  Operation not supported: TIPCLIENTHTTP:new()
Called from TIPCLIENT:NEW(0)
Called from TIPCLIENTHTTP:NEW(0)
Called from MAIN(17)


One last question; output for HB_SSLEAY_DIR seems incorrect under Windows.  I would expect something like c:\Windows\System32\     Is this ok?

Thank you.


Reinaldo.

Reinaldo

unread,
Aug 19, 2018, 6:24:19 PM8/19/18
to Harbour Users
Never mind.  Finally found the problem.  It seems as if you MUST REQUEST SSL.  as in:

REQUEST __HBEXTERN__HBSSL__


Adding that line before all else, seems to have solved the problem. 



Reinaldo.
Reply all
Reply to author
Forward
0 new messages