Hola amigos...
Ayer tuve un problema con Windows 7 y FW, resulta que Win-7 no soporta TLS1.0, esto tienen que ver con FW ? o es solo asunto del win-7, por que con Win-10 no hubo problemas
Gracias
//----------------------------------------------------------------------------//
// ( C ) Cristobal Navarro Lopez ( 2017 - 2018 )
//----------------------------------------------------------------------------//
#include "Fivewin.ch"
//----------------------------------------------------------------------------//
Function Main()
? CheckSSLTLSConexion()
Return nil
//----------------------------------------------------------------------------//
Function CheckSSLTLSConexion()
local oHttp
local cJson
local lTls := .F.
oHttp := CreateObject( "MSXML2.ServerXMLHTTP.3.0" )
oHttp:Open( "GET", "https://howsmyssl.com/a/check", .F. )
oHttp:Send()
cJson := hb_JsonDecode( oHttp:responseText )
if hb_HHaskey( cJson, "tls_version" )
if !Empty( cJson[ "tls_version" ] )
if hb_HHaskey( cJson, "rating" )
if !Empty( At( "ok", Lower( cJson[ "rating" ] ) ) )
? cJson[ "rating" ], cJson[ "tls_version" ]
lTls := .T.
endif
endif
endif
endif
//XBrowse( cJson )
oHttp := nil
Return lTls
//----------------------------------------------------------------------------//
cnavarro wrote:Hasta donde yo sé, no tiene nada que ver con Fw, ya que eso se controla en "Opciones de internet", que hay que elegir tu configuración
//----------------------------------------------------------------------------//
// ( C ) Cristobal Navarro Lopez ( 2017 - 2018 )
//----------------------------------------------------------------------------//
#include "Fivewin.ch"
//----------------------------------------------------------------------------//
FUNCTION Main()
? CheckSSLTLSConexion()
RETURN nil
//----------------------------------------------------------------------------//
FUNCTION CheckSSLTLSConexion()
LOCAL oHttp
LOCAL cJson
LOCAL lTls := .F.
Try
oHttp := CreateObject( "MSXML2.ServerXMLHTTP.3.0" )
oHttp:Open( "GET", "https://howsmyssl.com/a/check", .F. )
oHttp:Send()
IF ! oHttp:open()
? "Problemas?"
Break
ENDIF
cJSON := oHttp:readAll()
oHttp:close()
cJson := hb_JsonDecode( oHttp:responseText )
IF hb_HHaskey( cJson, "tls_version" )
IF !Empty( cJson[ "tls_version" ] )
IF hb_HHaskey( cJson, "rating" )
IF !Empty( At( "ok", Lower( cJson[ "rating" ] ) ) )
? cJson[ "rating" ], cJson[ "tls_version" ]
lTls := .T.
ENDIF
ENDIF
ENDIF
ENDIF
Catch
? "No funciona, Master Navarro..."
END
//XBrowse( cJson )
oHttp := nil
RETURN lTls
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
// ( C ) Cristobal Navarro Lopez ( 2017 - 2018 )
//----------------------------------------------------------------------------//
#include "Fivewin.ch"
#include "hbcompat.ch"
//----------------------------------------------------------------------------//
FUNCTION Main()
? CheckSSLTLSConexion()
RETURN nil
//----------------------------------------------------------------------------//
FUNCTION CheckSSLTLSConexion()
LOCAL oHttp
LOCAL cJson
LOCAL lTls := .F.
Try
// oHttp := CreateObject( "MSXML2.ServerXMLHTTP.3.0" )
#IFDEF __XHARBOUR__ // xHarbour
Try
oHttp := CreateObject( "MSXML2.ServerXMLHTTP.6.0" )
Catch
MsgInfo('Erro na Criação do Serviço')
Break
End
#ELSE
Try
oHttp := win_OleCreateObject( "MSXML2.ServerXMLHTTP.5.0")
Catch
MsgInfo('Erro na Criação do Serviço!', 'Atenção!')
Break
End
#ENDIF
oHttp:Open( "GET", "https://howsmyssl.com/a/check", .F. )
oHttp:Send()
IF ! oHttp:open()
? "Problemas?"
Break
ENDIF
cJSON := oHttp:readAll()
oHttp:close()
cJson := hb_JsonDecode( oHttp:responseText )
IF hb_HHaskey( cJson, "tls_version" )
IF !Empty( cJson[ "tls_version" ] )
IF hb_HHaskey( cJson, "rating" )
IF !Empty( At( "ok", Lower( cJson[ "rating" ] ) ) )
? cJson[ "rating" ], cJson[ "tls_version" ]
lTls := .T.
ENDIF
ENDIF
ENDIF
ENDIF
Catch
? "No funciona, Master Navarro..."
END
//XBrowse( cJson )
oHttp := nil
RETURN lTls
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
// ( C ) Cristobal Navarro Lopez ( 2017 - 2018 )
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
//#include "Fivewin.ch"
//----------------------------------------------------------------------------//
Function CheckTLSConex()
? CheckSSLTLSConexion()
Return nil
//----------------------------------------------------------------------------//
Function CheckSSLTLSConexion()
local oHttp
local lTls := .F., aHashResp
oHttp := CreateObject( "MSXML2.ServerXMLHTTP.3.0" )
oHttp:Open( "GET", "https://howsmyssl.com/a/check", .F. )
oHttp:Send()
//Este funciona (HARBOUR), pero resultado es diferente a si lo hacemos directamente desde el navegador dando click en el link.
aHashResp := Hash()
hb_JsonDecode( oHttp:responseText, @aHashResp )
XBrowse( aHashResp )
if hb_HHaskey( aHashResp, "tls_version" )
if !Empty( aHashResp[ "tls_version" ] )
if hb_HHaskey( aHashResp, "rating" )
if !Empty( aHashResp[ "rating" ] )
? aHashResp[ "rating" ], aHashResp[ "tls_version" ]
lTls := .T.
endif
endif
endif
endif
oHttp := nil
Return lTls
#ifdef __XHARBOUR__
#xtranslate hb_HHasKey( [<x,...>] ) => HHasKey( <x> )
#endif
cnavarro wrote:En tu ejemplo no veo gran diferencia con respecto al mio, debería funcionar. Cuál es la diferencia que has visto entre ejecutarlo en el explorador y con el ejemplo?
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 66 guests