cnavarro wrote:Eso no te preocupes, debe ser un comportamiento del propio webservice dependiendo del "location", lo importante es que te diga si tienes instalado TLS o no. Además no creo que tengas TLS 1.3 instalado. Yo sólo llego hasta el 1.2 y también me dice que tengo la 1.3
#include "Fivewin.ch"
//----------------------------------------------------------------------------//
Function Main()
MsgInfo( CkXhbTLSConexion() )
Return nil
//----------------------------------------------------------------------------//
Function CkXhbTLSConexion()
local oHttp
local cJson, aHashResp, cVersion:="", cRating:=""
local lTls := .F.
oHttp := CreateObject( "MSXML2.ServerXMLHTTP.3.0" )
oHttp:Open( "GET", "https://howsmyssl.com/a/check", .F. )
oHttp:Send()
cJson := oHttp:responseText
aHashResp := Hash()
hb_JsonDecode( cJson, @aHashResp )
if !Empty( cVersion := aHashResp["tls_version"] )
cRating := aHashResp["rating"]
MsgInfo( "Rating: "+cRating +CHR(13)+ "Version: "+cVersion )
lTls := .t.
endif
oHttp := nil
Return lTls
#include "Fivewin.ch"
//----------------------------------------------------------------------------//
Function Main()
MsgInfo( CkXhbTLSConexion() )
Return nil
//----------------------------------------------------------------------------//
Function CkXhbTLSConexion()
local oHttp
local cJson, aHashResp, cVersion:="", cRating:=""
local lTls := .F.
// 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' )
RETURN NIL
End
#else // Harbour
Try
oHttp := win_OleCreateObject( "MSXML2.ServerXMLHTTP.5.0" )
Catch
MsgInfo( 'Erro na Criação do Serviço!', 'Atenção!' )
RETURN NIL
End
#endif
oHttp:Open( "GET", "https://howsmyssl.com/a/check", .F. )
oHttp:Send()
cJson := oHttp:responseText
#ifdef __XHARBOUR__ // xHarbour
aHashResp := Hash()
#else // Harbour
aHashResp := HB_Hash()
#endif
hb_JsonDecode( cJson, @aHashResp )
if !Empty( cVersion := aHashResp["tls_version"] )
cRating := aHashResp["rating"]
// retorna siempre TLS 1.0 ?? - rating: BAD??
MsgInfo( "Rating: "+cRating +CHR(13)+ "Version: "+cVersion )
lTls := .t.
endif
oHttp := nil
Return( lTls )
/*
{"given_cipher_suites":["TLS_GREASE_IS_THE_WORD_1A",
"TLS_CHACHA20_POLY1305_SHA256","TLS_AES_128_GCM_SHA256","TLS_AES_256_GCM_SHA384",
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","TLS_RSA_WITH_AES_128_GCM_SHA256",
"TLS_RSA_WITH_AES_256_GCM_SHA384","TLS_RSA_WITH_AES_128_CBC_SHA",
"TLS_RSA_WITH_AES_256_CBC_SHA","TLS_RSA_WITH_3DES_EDE_CBC_SHA"],"ephemeral_keys_supported":true,
"session_ticket_supported":true,"tls_compression_supported":false,
"unknown_cipher_suite_supported":false,"beast_vuln":false,"able_to_detect_n_minus_one_splitting":
false,"insecure_cipher_suites":{},"tls_version":"TLS 1.3",
"rating":"Probably Okay"}
*/
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 59 guests