-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Multiple disconnects in handshake using ssl_server with Chromium browser #10014
Comments
Hi, thanks for this report! Looking at the netlog from Chromium, it looks like the error was I would guess that what is happening with other servers is that they are falling back to a non-TLS (i.e. raw HTTP) connection when the TLS connection fails, hence they still display the page. Our demonstration servers don't do this since the whole point of Mbed TLS is to do TLS. You should be able to rectify this in your browser by importing a copy of your certificate in Chromium's settings. Based on my local copy of Chromium, it looks like this can be done by going to Settings > Privacy and security > Security > Manage certificates > Authorities, but I'm no expert. |
I was able to analyse via netlog and Wireshark that other TLS servers perform the TLS handshake on the first attempt, although they use a similar self-signed certificate. In my application, a status request is sent every second. When using Chrome, this means that there are always 3 handshakes per second: 2 fail and 1 succeed. So there must be something special with mbedTLS. Unfortunately, Chrome's netlog does not provide much information. It seems as if Chrome ignores an error on the 3rd attempt. I was able to extract the following from the Chromium debug log:
|
Hmm, that's strange. Have you tried looking at the logs from |
The debug output only shows that the server successfully sends its finish message, whereupon Chromium obviously closes the connection. After the 3rd attempt it works.
See full log: debug.txt |
I'm unsure if this is the issue, but have you checked that |
In my implementation I use a self-signed certificate and in the tests with ssl-server I use the PolarSSL certificate. The result is the same: 2x failed handshake, then the handshake works |
Summary
I noticed many errors during the TLS handshake when using a self-signed server certificate. To rule out an error on my side, I tried ssl_server.exe, which shows the same disconnections during the handshake.
System information
Mbed TLS version: 3.6.2
Operating system and version: Windows 10
Configuration: mbedtls_config.txt
Expected behavior
When requesting https://localhost:4433/ with a Chromium browser, the TLS handshake should take place without any connection interruptions.
Actual behavior
Only the 3rd attempt at a TLS handshake succeeds. This can be seen in the console output of ssl_server and via chrome netlog.
Steps to reproduce
Start ssl_server, open Chrome or Chromium browser and navigate to https://localhost:4433/
Additional information
Other web servers with self-signed certificates are able to perform a handshake without connection failure on the first attempt.
The text was updated successfully, but these errors were encountered: