Problemas con TLS1.0

Re: Problemas con TLS1.0

Postby karinha » Mon Sep 09, 2019 1:08 pm

Creo sea un problema de versión de mi internet explorer. No me funciona ni em Harbour i ni en xHabrour, Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7848
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Problemas con TLS1.0

Postby FranciscoA » Mon Sep 09, 2019 2:10 pm

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

Gracias, Maestro.
Saludos.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Problemas con TLS1.0

Postby FranciscoA » Mon Sep 09, 2019 4:29 pm

Joao:
Este codigo me funciona en Harbour y XHarbour.

Code: Select all  Expand view  RUN
#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
 

Saludos.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Problemas con TLS1.0

Postby karinha » Mon Sep 09, 2019 5:33 pm

Gracias, Francisco.

Code: Select all  Expand view  RUN

#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"}
*/

 


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7848
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests