Internal error NX_SECURE_TLS_INVALID_STATE when connecting to a NetX Duo Secure server

Grégoire DEFOY 20 Reputation points
2023-03-10T11:13:27.5833333+00:00

I have followed the documentation https://video2.skills-academy.com/en-us/azure/rtos/netx-duo/netx-secure-tls/chapter2 to create a tls server with the NetX Duo Secure addon.

When I connect to the server and when i process the client hello, i get an internal error telling me that there are no ciphersuites, is there something to initialize the ciphersuites ?

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
331 questions
{count} votes

2 answers

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 32,946 Reputation points
    2023-03-10T13:12:52.8533333+00:00

    Grégoire DEFOY Welcome to Microsoft Q&A forum!

    Internal error NX_SECURE_TLS_INVALID_STATE when connecting to a NetX Duo Secure server When I connect to the server and when i process the client hello, i get an internal error telling me that there are no ciphersuites, is there something to initialize the ciphersuites ?

    The error "NX_SECURE_TLS_INVALID_STATE" can occur when the TLS state is incorrect.

    You can try the following steps to resolve the issue:

    • Confirm that the TLS state is correct.
    • Check the TLS state machine to ensure that the correct state is being used.
    • Ensure that the TLS session was not terminated unexpectedly.

    Also, The documentation which you are following show the basic outlines for a TLS Client and Server, respectively, but for clarity the error handling is omitted. However, part of the security TLS provides is dependent on the proper handling of error conditions. Generally, the most serious potential problems will be handled within the TLS stack itself, but it is important for the TLS application to properly respond to and recover from TLS errors that are not handled within the TLS implementation.

    Please double check the sample and try the error handling. See the section A Note on TLS Session Error Recovery for more details.

    When I connect to the server and when i process the client hello, i get an internal error telling me that there are no ciphersuites, is there something to initialize the ciphersuites ?

    It's possible that the ciphersuites have not been properly initialized. Ensure that it has been included.

    User's image

    If you need further help in this matter, please comment in the below section and we are happy to discuss!


    If this answers your query, do click Accept Answer and Yes for this answer as helpful. And, if you have any further query do let us know by commenting in the below section.


  2. Grégoire DEFOY 20 Reputation points
    2023-03-20T09:49:04.0266667+00:00

    I managed to solve the problem,

    This was due to the ssl certificate generation.

    I was not able to get NetX to validate a PKCS-1 key, as it was not in the right format, so i switched to a EC encoded private key, which was accepted in the nx_secure_x509_certificate_initialize() function. This worked and initialized the certificate. but when connecting with openssl, the EC methods were not working, so an error was thrown.

    When I finally managed to convert a RSA key to the PKCS-1 format, and initialize it, everything worked.

    I'd like to thank everyone in this thread for their time.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.