Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MbedTlsError(-30592) after upgrading to commit d5e29f8 #60

Open
yanshay opened this issue Nov 20, 2024 · 2 comments
Open

MbedTlsError(-30592) after upgrading to commit d5e29f8 #60

yanshay opened this issue Nov 20, 2024 · 2 comments

Comments

@yanshay
Copy link
Contributor

yanshay commented Nov 20, 2024

This is an issue as followup to discussion #57, so it's not forgotten.

I have a program that works using esp-mbedtls (async)
I upgraded to the latest commit, it required adding SHA parameter to the Session::new and did the same as the example.
I started receiving MbedTlsError(-30592) which based on error codes I found mean:
0x7780 SSL - A fatal alert message was received from our peer.

Note that I'm using TLS1.2 (that's why I'm using esp-mbedtls).

The issue is probably due to the use of ca_chain: None which wasn't considered in that change.

        let tls_starter = match esp_mbedtls::asynch::Session::new(
            socket,
            "",
            esp_mbedtls::Mode::Client,
            esp_mbedtls::TlsVersion::Tls1_2,
            esp_mbedtls::Certificates {
                ca_chain: None,
                ..Default::default()
            },
            tls_rx_buffer,
            tls_tx_buffer,
            &mut sha
        ) {
            Ok(tls_starter) => tls_starter.with_hardware_rsa(&mut rsa),
            Err(e) => {
                error!(boot, "Error establishing TLS Connection {:?}",e);
                Timer::after(Duration::from_millis(500)).await;
                continue; // to external loop
            }
        };

@yanshay
Copy link
Contributor Author

yanshay commented Nov 21, 2024

Following the guidelines in the discussion that originated this issue I activated logs.
Attached are the logs (good.txt and bad.txt) I managed to extract with those steps. I also had to set ESP_LOGS to trace to see something. good is before the change. bad is after the change.
Are these the logs to expect? There's not much there. The two files are almost identical except at the end.
At line 56 the good sends 6 bytes and the bad 7 bytes. And close after that the bad session ends with an error.

bad.txt
good.txt

@yanshay
Copy link
Contributor Author

yanshay commented Dec 9, 2024

Can anyone assist with this?

@ivmarkov I noticed you referenced this on your PR, maybe you know what could cause this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant