Topic: SendClientKeyExchange fail

here is source  code ,who know why?
 
   wolfSSL_Init();     
      client->data.ctx = SSL_CTX_new(wolfSSLv3_client_method());     
     
   
      if (wolfSSL_CTX_set_cipher_list(client->data.ctx, cipherList) != SSL_SUCCESS)
      {
        uart_printf( "set cipher error" );
      }
     
      base64decode( host_root_ca_buffer , &lengh  , lock_rev_buffer);
      ret = wolfSSL_CTX_use_certificate_buffer(client->data.ctx,lock_rev_buffer, lengh, SSL_FILETYPE_PEM);
     
      base64decode( host_root_key_buffer , &lengh  , lock_rev_buffer);
      ret = wolfSSL_CTX_use_PrivateKey_buffer(client->data.ctx,lock_rev_buffer, lengh , SSL_FILETYPE_PEM );     


      client->data.ssl = SSL_new(client->data.ctx);
     
      client->data.bio = wolfSSL_BIO_new_socket((int)client->connection,0);

      wolfSSL_set_bio(client->data.ssl, client->data.bio, client->data.bio);
      wolfSSL_CTX_set_verify(client->data.ctx, SSL_VERIFY_NONE, 0);
      SSL_set_connect_state(client->data.ssl);
     ///// wolfSSL_set_group_messages(client->data.ssl);

     // client_ssl_handshake(client->data.ssl);
     
      if (wolfSSL_negotiate(client->data.ssl) != SSL_SUCCESS)
      {
        BIO_free(client->data.bio);
        SSL_CTX_free(client->data.ctx);
        SSL_free(client->data.ssl);   
        return LOCKDOWN_STATUS_START_SESSION_FAILED;
       
      }

Share

Re: SendClientKeyExchange fail

i tested the  client  example project ,when i change the method to method = wolfSSLv3_client_method(), wolfSSL_connect return fail ,when i change it to          method = wolfTLSv1_2_client_method(); it works ! so ,who know why?

Share

Re: SendClientKeyExchange fail

Hi zhbn,

It sounds like the server you are testing against is only using TLS 1.2.  Are you testing against the wolfSSL embedded SSL example server?

If you would like to use SSL 3.0 with the wolfSSL example server, you can change the protocol version used with the "-v" option, i.e.:

./examples/server/server -v 0

Best Regards,
Chris