Is TIpClientHttp supposed to work for secured sites?
Moderator: Rathinagiri
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Is TIpClientHttp supposed to work for secured sites?
Danielle, thanks for clearing up the missing pieces. I understand now.
Serge, I'll take another look at HMG. Hopefully, it works smoothly with Minigui.
Serge, I'll take another look at HMG. Hopefully, it works smoothly with Minigui.
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Is TIpClientHttp supposed to work for secured sites?
Serge,
I was able to make the build work with the hbc/hbp file, and that solves a whole host of problems.
But unfortunately, I'm still getting an error when using an https url as the parameter to new():
Error BASE/1081 Operation not supported: TIPCLIENTHTTP:new() Args: [1] = O TIPCLIENTHTTP [2] = C https
I'll try tracing through the class again, to see if something pops out that isn't immediately obvious.
I was able to make the build work with the hbc/hbp file, and that solves a whole host of problems.
But unfortunately, I'm still getting an error when using an https url as the parameter to new():
Code: Select all
Http_o := TIpClientHttp():New( ChangeLink_s )
Error BASE/1081 Operation not supported: TIPCLIENTHTTP:new() Args: [1] = O TIPCLIENTHTTP [2] = C https
I'll try tracing through the class again, to see if something pops out that isn't immediately obvious.
serge_girard wrote: ↑Wed Jul 22, 2020 2:13 pm Try this:
In your HBC filein your HBP fileCode: Select all
inc=yes head=native libs=hbssl libs=libeay32 libs=ssleay32
SergeCode: Select all
hbssl.hbc
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: Is TIpClientHttp supposed to work for secured sites?
hi,
have a look at c:\harbour\contrib\hbtip\tests\http_adv.prg
have a look at c:\harbour\contrib\hbtip\tests\http_adv.prg
Code: Select all
http_adv.exe https://www.hmgforum.com/viewtopic.php?f=5&t=6531
Connecting with www.hmgforum.com
Connection eshtablished
Retrieving / viewtopic.php f=5
Get Successful
Date: Tue, 28 Jul 2020 00:55:15 GMT
Server: Apache
Cache-Control: private, no-cache="set-cookie"
Expires: Tue, 28 Jul 2020 00:55:16 GMT
Referrer-Policy: strict-origin-when-cross-origin
Set-Cookie: phpbb3_8539k_sid=c26d0f6976f9d19fd89ccf4b4f4ed3ec; expires=Wed, 28-Jul-2021 00:55:16 GMT; path=/; domain=hmg
forum.com; HttpOnly
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Done
Press any key to continue...
have fun
Jimmy
Jimmy
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Is TIpClientHttp supposed to work for secured sites?
Thanks Auge,
the answer is in this check, in the http_adv.prg module:
tip_SSL() is returning false.
Gotta stop for the night, but at least I have a direction for tomorrow.
Thanks & regards,
the answer is in this check, in the http_adv.prg module:
Code: Select all
IF oURL:cProto == "https" .AND. ! tip_SSL()
? "Error: Requires SSL support"
RETURN
ENDIF
Gotta stop for the night, but at least I have a direction for tomorrow.
Thanks & regards,
AUGE_OHR wrote: ↑Tue Jul 28, 2020 12:57 am hi,
have a look at c:\harbour\contrib\hbtip\tests\http_adv.prg
Code: Select all
http_adv.exe https://www.hmgforum.com/viewtopic.php?f=5&t=6531
Connecting with www.hmgforum.com
Connection eshtablished
Retrieving / viewtopic.php f=5
Get Successful
Date: Tue, 28 Jul 2020 00:55:15 GMT
Server: Apache
Cache-Control: private, no-cache="set-cookie"
Expires: Tue, 28 Jul 2020 00:55:16 GMT
Referrer-Policy: strict-origin-when-cross-origin
Set-Cookie: phpbb3_8539k_sid=c26d0f6976f9d19fd89ccf4b4f4ed3ec; expires=Wed, 28-Jul-2021 00:55:16 GMT; path=/; domain=hmg
forum.com; HttpOnly
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Done
Press any key to continue...
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: Is TIpClientHttp supposed to work for secured sites?
hi,
i have change HMG32.HBC for SSL an Email
i have change HMG32.HBC for SSL an Email
Code: Select all
# paths
incpaths=/.
incpaths=include
libpaths=lib
# main hmg libs
libs=hmg
libs=crypt
libs=edit
libs=editex
libs=graph
libs=ini
libs=report
libs=hfcl
# system libs
libs=msvfw32
libs=vfw32
# harbour contrib libs
libs=hbmysql
libs=mysql
libs=hbfimage
libs=hbpgsql
libs=sddmy
libs=hbvpdf
libs=hbct
libs=hbwin
libs=hbmzip
libs=minizip
libs=hbmemio
libs=hbmisc
libs=hbtip
libs=sqlite3
libs=hbsqlit3
libs=sddodbc
libs=rddsql
libs=hbodbc
libs=odbc32
libs=hbhpdf
libs=hbnetio
libs=xhb
libs=png
libs=libhpdf
libs=hbzebra
# ***** include this lines *****
libs=hbssl
libs=libeay32
libs=ssleay32
Libs=hbtip
# ***** end include this lines *****
# link compiled resources
sources=${hb_curdir}_temp.o
have fun
Jimmy
Jimmy
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Is TIpClientHttp supposed to work for secured sites?
Update: Got it, after throwing in:
REQUEST __HBEXTERN__HBSSL__
Disregard the rest, just leaving it for anyone researching the topic in the future.
Thanks everyone, for their assistance. I'll get a donation to the project this week, if they take donations.
****************************************************************************
Yikes. Still not working, not sure what's missing.
This is my hbc file:
, and the HB_STATIC_OPENSSL environmental variable is set, before running the app:
Where is tip_SSL() defined? Maybe looking at that, would give me a clue.
REQUEST __HBEXTERN__HBSSL__
Disregard the rest, just leaving it for anyone researching the topic in the future.
Thanks everyone, for their assistance. I'll get a donation to the project this week, if they take donations.
****************************************************************************
Yikes. Still not working, not sure what's missing.
This is my hbc file:
Code: Select all
inc=yes
head=native
libpaths=c:\HWDebug
libs=hwgdebug
libs=hbssl
libs=libeay32
libs=ssleay32
libs=hbtip
Code: Select all
SET HB_STATIC_OPENSSL=yes
Where is tip_SSL() defined? Maybe looking at that, would give me a clue.
- danielmaximiliano
- Posts: 2625
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Is TIpClientHttp supposed to work for secured sites?
f you are going to use the hbtip library with the different secure sites (read HTTPs, POP3s, FTPs, IMAPs), it is suggested that this library be compiled with SSL (Secure Sockets Layer) support.HGAutomator wrote: ↑Tue Jul 28, 2020 3:18 pm Where is tip_SSL() defined? Maybe looking at that, would give me a clue.
in this case you should add "SET HB_STATIC_OPENSSL=yes"
as is indicated in : https://github.com/harbour/core#how-to- ... components
in "C:\Harbour\contrib\hbtip" generate or run line by line from CMD to create such libraries
Code: Select all
rem @echo off
rem *************************************
rem ADD in case Install OpenSSL
SET HB_WITH_OPENSSL=C:\OpenSSL32\include
SET HB_STATIC_OPENSSL=yes
rem *************************************
set Backup=%path%
set path=%path%;C:\hmg.3.4.4;c:\openssl32;C:\OpenSSL32\include
build hbtip.hbp
set path=%backup%
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Is TIpClientHttp supposed to work for secured sites?
Hi Daniel,
Yep, that's in both my batch file, and in the application, using hb_SetEnv.
Almost everything is working fine, except for trying to readall(), which returns nothing. The headers are returned, and they contain data. But that's a separate issue. The response code is a 301, so maybe I have to use a diferent url, after retriving it from another property of the TIpClientHttp class. Don't know, yet.
I tested the equivalent code with Xailer's TInternet class, and was able to download the html. So that's available, in the meantime.
So for now, everything's good. Just have to explore & experiment further.
Yep, that's in both my batch file, and in the application, using hb_SetEnv.
Almost everything is working fine, except for trying to readall(), which returns nothing. The headers are returned, and they contain data. But that's a separate issue. The response code is a 301, so maybe I have to use a diferent url, after retriving it from another property of the TIpClientHttp class. Don't know, yet.
I tested the equivalent code with Xailer's TInternet class, and was able to download the html. So that's available, in the meantime.
So for now, everything's good. Just have to explore & experiment further.
danielmaximiliano wrote: ↑Tue Jul 28, 2020 6:16 pmf you are going to use the hbtip library with the different secure sites (read HTTPs, POP3s, FTPs, IMAPs), it is suggested that this library be compiled with SSL (Secure Sockets Layer) support.HGAutomator wrote: ↑Tue Jul 28, 2020 3:18 pm Where is tip_SSL() defined? Maybe looking at that, would give me a clue.
in this case you should add "SET HB_STATIC_OPENSSL=yes"
as is indicated in : https://github.com/harbour/core#how-to- ... components
in "C:\Harbour\contrib\hbtip" generate or run line by line from CMD to create such librariesCode: Select all
rem @echo off rem ************************************* rem ADD in case Install OpenSSL SET HB_WITH_OPENSSL=C:\OpenSSL32\include SET HB_STATIC_OPENSSL=yes rem ************************************* set Backup=%path% set path=%path%;C:\hmg.3.4.4;c:\openssl32;C:\OpenSSL32\include build hbtip.hbp set path=%backup%
Re: Is TIpClientHttp supposed to work for secured sites?
301 is a redirection directive
Angel Pais
Web Apps consultant/architect/developer.
Web Apps consultant/architect/developer.
- danielmaximiliano
- Posts: 2625
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Is TIpClientHttp supposed to work for secured sites?
this is what I found about answer 301HGAutomator wrote: ↑Tue Jul 28, 2020 8:00 pm Almost everything is working fine, except for trying to readall(), which returns nothing. The headers are returned, and they contain data. But that's a separate issue. The response code is a 301, so maybe I have to use a diferent url, after retriving it from another property of the TIpClientHttp class. Don't know, yet.
https://tools.ietf.org/html/rfc2616#section-9.2
10.3.2 301 Moved Permanently
The requested resource has been assigned a new permanent URI and any
future references to this resource SHOULD use one of the returned
URIs. Clients with link editing capabilities ought to automatically
re-link references to the Request-URI to one or more of the new
references returned by the server, where possible. This response is
cacheable unless indicated otherwise.
The new permanent URI SHOULD be given by the Location field in the
response. Unless the request method was HEAD, the entity of the
response SHOULD contain a short hypertext note with a hyperlink to
the new URI(s).
If the 301 status code is received in response to a request other
than GET or HEAD, the user agent MUST NOT automatically redirect the
request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued.
Note: When automatically redirecting a POST request after
receiving a 301 status code, some existing HTTP/1.0 user agents
will erroneously change it into a GET request.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO