- Code: Select all Expand view RUN
- oCli:nDefaultPort = nPort
oCli:lSSL = .T.
oCli:nDefaultPort = nPort
oCli:lSSL = .T.
Enrico Maria Giordano wrote:I need a reduced and self-contained sample that I can compile and execute here. In the meantime, you can try assigning these:
- Code: Select all Expand view RUN
oCli:nDefaultPort = nPort
oCli:lSSL = .T.
tipssl.lib
libssl.lib
libcrypto.lib
Enrico Maria Giordano wrote:Sorry, I can't execute your sample. Anyway, I forgot to mention that you have to replace tip.lib with:
- Code: Select all Expand view RUN
tipssl.lib
libssl.lib
libcrypto.lib
Try and let me know.
// https://docwiki.embarcadero.com/RADStud ... _for_Win32
/*
IMPLIB <options> <LibName>[.lib] [<DefFiles>... | <DLLs>... ]^
[@<ResponseFile> | <sourcename> ] [<sourcename> ...]
*/
C:\BCC76\BIN\IMPLIB ACBrMail32.lib ACBrMail32.dll
C:\BCC76\BIN\IMPLIB tipssl.lib tipssl.dll
C:\BCC76\BIN\IMPLIB libssl.lib libssl.dll
C:\BCC76\BIN\IMPLIB libcrypto.lib libcrypto.dll
Enrico Maria Giordano wrote:Have you put libssl.lib and libcrypto.lib too?
karinha wrote:https://docwiki.embarcadero.com/RADStudio/Alexandria/en/IMPLIB.EXE,_the_Import_Library_Tool_for_Win32
Arteaga, ejemplo de como generar las *.LIBs
- Code: Select all Expand view RUN
// https://docwiki.embarcadero.com/RADStud ... _for_Win32
/*
IMPLIB <options> <LibName>[.lib] [<DefFiles>... | <DLLs>... ]^
[@<ResponseFile> | <sourcename> ] [<sourcename> ...]
*/
C:\BCC76\BIN\IMPLIB ACBrMail32.lib ACBrMail32.dll
C:\BCC76\BIN\IMPLIB tipssl.lib tipssl.dll
C:\BCC76\BIN\IMPLIB libssl.lib libssl.dll
C:\BCC76\BIN\IMPLIB libcrypto.lib libcrypto.dll
Regards, saludos.
C:\XHBBCC76\lib\vm.Lib +
C:\XHBBCC76\lib\rdd.Lib +
C:\XHBBCC76\lib\common.Lib +
C:\XHBBCC76\lib\rtl.Lib +
C:\XHBBCC76\lib\lang.Lib +
C:\XHBBCC76\lib\macro.Lib +
C:\XHBBCC76\lib\hbsix.Lib +
C:\XHBBCC76\lib\dbfntx.Lib +
C:\XHBBCC76\lib\PcRepos.Lib +
C:\XHBBCC76\lib\dbffpt.Lib +
C:\XHBBCC76\lib\dbfcdx.Lib +
C:\XHBBCC76\lib\hbzip.Lib +
C:\XHBBCC76\lib\hbmzip.Lib +
C:\XHBBCC76\lib\zlib.Lib +
C:\XHBBCC76\lib\ct.Lib +
C:\XHBBCC76\lib\gtgui.Lib +
C:\XHBBCC76\lib\tip.Lib +
C:\XHBBCC76\lib\hbzebra.Lib +
C:\XHBBCC76\lib\codepage.Lib +
C:\XHBBCC76\lib\png.Lib +
C:\XHBBCC76\lib\pp.Lib +
c:\XHBBCC76\lib\libcrypto.lib +
c:\XHBBCC76\lib\libssl.lib +
c:\XHBBCC76\lib\tipssl.lib +
C:\BCC76\lib\cw32.Lib +
C:\BCC76\lib\uuid.lib +
C:\BCC76\lib\ws2_32.lib +
C:\BCC76\lib\import32.lib +
C:\BCC76\lib\psdk\msimg32.Lib +
C:\BCC76\lib\psdk\odbc32.Lib +
C:\BCC76\lib\psdk\rasapi32.Lib +
C:\BCC76\lib\psdk\nddeapi.Lib +
C:\BCC76\lib\psdk\psapi.Lib +
C:\BCC76\lib\psdk\gdiplus.lib +
C:\BCC76\lib\psdk\iphlpapi.Lib +
C:\BCC76\lib\psdk\shell32.lib +
C:\BCC76\lib\psdk\wininet.Lib +
C:\BCC76\lib\import32.Lib
karinha wrote:Arteaga, mira si estas usando todas las LIBs:
- Code: Select all Expand view RUN
C:\XHBBCC76\lib\vm.Lib +
C:\XHBBCC76\lib\rdd.Lib +
C:\XHBBCC76\lib\common.Lib +
C:\XHBBCC76\lib\rtl.Lib +
C:\XHBBCC76\lib\lang.Lib +
C:\XHBBCC76\lib\macro.Lib +
C:\XHBBCC76\lib\hbsix.Lib +
C:\XHBBCC76\lib\dbfntx.Lib +
C:\XHBBCC76\lib\PcRepos.Lib +
C:\XHBBCC76\lib\dbffpt.Lib +
C:\XHBBCC76\lib\dbfcdx.Lib +
C:\XHBBCC76\lib\hbzip.Lib +
C:\XHBBCC76\lib\hbmzip.Lib +
C:\XHBBCC76\lib\zlib.Lib +
C:\XHBBCC76\lib\ct.Lib +
C:\XHBBCC76\lib\gtgui.Lib +
C:\XHBBCC76\lib\tip.Lib +
C:\XHBBCC76\lib\hbzebra.Lib +
C:\XHBBCC76\lib\codepage.Lib +
C:\XHBBCC76\lib\png.Lib +
C:\XHBBCC76\lib\pp.Lib +
c:\XHBBCC76\lib\libcrypto.lib +
c:\XHBBCC76\lib\libssl.lib +
c:\XHBBCC76\lib\tipssl.lib +
C:\BCC76\lib\cw32.Lib +
C:\BCC76\lib\uuid.lib +
C:\BCC76\lib\ws2_32.lib +
C:\BCC76\lib\import32.lib +
C:\BCC76\lib\psdk\msimg32.Lib +
C:\BCC76\lib\psdk\odbc32.Lib +
C:\BCC76\lib\psdk\rasapi32.Lib +
C:\BCC76\lib\psdk\nddeapi.Lib +
C:\BCC76\lib\psdk\psapi.Lib +
C:\BCC76\lib\psdk\gdiplus.lib +
C:\BCC76\lib\psdk\iphlpapi.Lib +
C:\BCC76\lib\psdk\shell32.lib +
C:\BCC76\lib\psdk\wininet.Lib +
C:\BCC76\lib\import32.Lib
Regards, saludos.
karinha wrote:Arteaga, I don't have an example that uses SSL with HTTPS, do you have anything to send me?
Arteaga, no tengo un ejemplo que use SSL con HTTPS, ¿tienes algo para enviarme?
Regards, saludos.
// C:\FWH..\SAMPLES\WARTIAG4.PRG
#include "Fivewin.ch"
#include "tip.ch" // ARISTON.PRG
FUNCTION Main()
LOCAL oDlg, oGet
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := Date()
inicio := 0
SET CENTURY ON
SET DATE TO BRITISH
SET EPOCH TO 1960
SET Multiple ON
SET DELETED ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet1 VAR Inicio OF oDlg SIZE 100, 10 COLOR "W/G" PICTURE "99999999"
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION Averba()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
STATIC FUNCTION Averba()
LOCAL oUrl, oCli, url
LOCAL hQUery := Hash()
url := "https://apis.averbeporto.com.br/php/conn.php"
TRY
// oUrl = TUrl():New( 'https://apis.averbeporto.com.br/php/conn.php' )
oUrl := TUrl():New( url ) // From tip.lib
oCli := TipClientHttp():New( oUrl, .f. ) // From tip.lib
// oCli = TIPClientHttp():New( oUrl )
CATCH
MsgInfo('Conection Error','Erro')
RETURN NIL
END
IF .NOT. Empty( oUrl )
// oCli = TIPClientHttp():New( oUrl )
IF .NOT. Empty( oCli )
oCli:nConnTimeout = -1
oCli:lSSL = .T.
IF oCli:Open()
hQuery[ "mod" ] := "login"
hQuery[ "comp" ] := "5"
hQuery[ "user" ] := "xxxxxxxxxxxx"
hQuery[ "pass" ] := "xxxxxxxxxxxx"
oCli:cUserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'
IF !oCli:PostMultiPart( hQuery )
CurSorArrow()
MsgInfo( oCli:lastErrorMessage, 'Error' )
ELSE
cNFSeResp := oCli:ReadAll()
RespC := oCli:GetCookies() // Get cookie
ENDIF
oCli:Close()
ENDIF
ENDIF
ENDIF
msginfo( cNFSeResp )
msginfo( RespC )
RETURN NIL
//--------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//--------------------------------------------------------------------------//
/* // teste
#include "FiveWin.ch"
#include "tip.ch"
FUNCTION RetPublicIP()
LOCAL cPubIP := "", cxHtml := "", url, oUrl, oHttp, oErr
url := "http://checkip.dyndns.org"
try
oUrl:=TUrl():New( url ) // From tip.lib
oHttp := TipClientHttp():New( oUrl , .f. ) // From tip.lib
catch oErr
? "Erro: "+oErr:Description
end try
Try
oHttp:Open()
cxHtml := oHttp:ReadAll() // Baixa todo o conteúdo do site.
cPubIP := allTrim( substr( substr( cxHtml, rat( "<body>", cxHtml ) + 26 ), 1, At( "<", substr( cxHtml, rat( "<body>", cxHtml ) + 26 ) ) - 1 ) )
catch oErr
? "Erro: "+oErr:Description
End
oHttp:Close()
DeleteUrlCacheEntry(url) // Lipar Cache
? cPubIP
Return Nil
//----------------------------------------------------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//----------------------------------------------------------------------------------------------------------------------//
*/
karinha wrote:Intente ahoha:
http://fivewin.com.br/index.php?/topic/26897-ip-p%C3%BAblico/
- Code: Select all Expand view RUN
// C:\FWH..\SAMPLES\WARTIAG4.PRG
#include "Fivewin.ch"
#include "tip.ch" // ARISTON.PRG
FUNCTION Main()
LOCAL oDlg, oGet
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := Date()
inicio := 0
SET CENTURY ON
SET DATE TO BRITISH
SET EPOCH TO 1960
SET Multiple ON
SET DELETED ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet1 VAR Inicio OF oDlg SIZE 100, 10 COLOR "W/G" PICTURE "99999999"
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION Averba()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
STATIC FUNCTION Averba()
LOCAL oUrl, oCli, url
LOCAL hQUery := Hash()
url := "https://apis.averbeporto.com.br/php/conn.php"
TRY
// oUrl = TUrl():New( 'https://apis.averbeporto.com.br/php/conn.php' )
oUrl := TUrl():New( url ) // From tip.lib
oCli := TipClientHttp():New( oUrl, .f. ) // From tip.lib
// oCli = TIPClientHttp():New( oUrl )
CATCH
MsgInfo('Conection Error','Erro')
RETURN NIL
END
IF .NOT. Empty( oUrl )
// oCli = TIPClientHttp():New( oUrl )
IF .NOT. Empty( oCli )
oCli:nConnTimeout = -1
oCli:lSSL = .T.
IF oCli:Open()
hQuery[ "mod" ] := "login"
hQuery[ "comp" ] := "5"
hQuery[ "user" ] := "xxxxxxxxxxxx"
hQuery[ "pass" ] := "xxxxxxxxxxxx"
oCli:cUserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'
IF !oCli:PostMultiPart( hQuery )
CurSorArrow()
MsgInfo( oCli:lastErrorMessage, 'Error' )
ELSE
cNFSeResp := oCli:ReadAll()
RespC := oCli:GetCookies() // Get cookie
ENDIF
oCli:Close()
ENDIF
ENDIF
ENDIF
msginfo( cNFSeResp )
msginfo( RespC )
RETURN NIL
//--------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//--------------------------------------------------------------------------//
/* // teste
#include "FiveWin.ch"
#include "tip.ch"
FUNCTION RetPublicIP()
LOCAL cPubIP := "", cxHtml := "", url, oUrl, oHttp, oErr
url := "http://checkip.dyndns.org"
try
oUrl:=TUrl():New( url ) // From tip.lib
oHttp := TipClientHttp():New( oUrl , .f. ) // From tip.lib
catch oErr
? "Erro: "+oErr:Description
end try
Try
oHttp:Open()
cxHtml := oHttp:ReadAll() // Baixa todo o conteúdo do site.
cPubIP := allTrim( substr( substr( cxHtml, rat( "<body>", cxHtml ) + 26 ), 1, At( "<", substr( cxHtml, rat( "<body>", cxHtml ) + 26 ) ) - 1 ) )
catch oErr
? "Erro: "+oErr:Description
End
oHttp:Close()
DeleteUrlCacheEntry(url) // Lipar Cache
? cPubIP
Return Nil
//----------------------------------------------------------------------------------------------------------------------//
DLL Function DeleteUrlCacheEntry(lpszUrlName AS STRING) AS LONG PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
//----------------------------------------------------------------------------------------------------------------------//
*/
Regards, saludos.
Return to WhatsNew / Novedades
Users browsing this forum: No registered users and 23 guests