-
Notifications
You must be signed in to change notification settings - Fork 68
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
EIO: Getting `Tls Failure (Fatal MACMismatch) #457
Comments
I made another branch which uses /cc @talex5 Update: Here's the diff of the two branches (https://github.com/bikallem/ocaml-dns/compare/eio-tls...bikallem:ocaml-dns:eio-ssl?expand=1) |
Can't see anything obviously wrong (what are you using the I suggest:
Maybe you're doing overlapping reads or overlapping writes somewhere? You could put a mutex around those operations to check. Finally, does it work with the lwt+tls version of Dns? |
It is the same with or without. |
Dear @bikallem, thanks for the report. Could you in a bit more detail elaborate to which host (IP/hostname and port number) you're trying to connect? Does a connection to the same host using tls-lwt or tls-mirage lead to the same issues? Or is it only the tls-eio package that shows these issues? If the latter, would you mind to elaborate which versions of ocaml, eio, and tls you're using? |
I went ahead and created a similar executable (ohost.exe) as the one in dns-client-eio. The error doesn't manifest in the lwt version. As verified above, it works correctly if
Both versions connect to the same nameserver ip, port (https://github.com/bikallem/ocaml-dns/blob/eio-tls/eio/client/dns_client_eio.ml#L78) and https://github.com/bikallem/ocaml-dns/blob/eio-tls/lwt/client/dns_client_lwt.ml#L156
Yes, I only experience errors with |
Thanks for your investigation. Maybe the path forward is to set the log level of tls.tracing to debug, and compare what is done for lwt and eio, and what is different. |
I had a go at reproducing this using your Does this still happen with the current code? It would be good to have step-by-step instructions to see the error with the latest version if so. Perhaps a Dockerfile that builds and runs the test? In any case, I suggest using match Eio.Flow.single_read ctx.ns_connection ctx.recv_buf with
| got ->
let recv_data = append_recv_buf ctx got recv_data in
handle_data recv_data
| exception End_of_file -> which seems unnecessarily low-level. |
I attempted to reproduce the issue over last Christmas break but couldn't quite pinpoint the exact reproduction. I believe this bit seemed to trigger the issue intermittently. Eio.Fiber.first
(fun () -> recv_packet ctx ctx.ns_connection request_id)
(fun () -> Eio.Promise.await response_p) However, I couldn't quite pinpoint the exact issue since the actual error is intermingled with the eio error,
I have since reworked the dns-client-eio PR to remove the use of |
I really couldn't pin down the replication steps on this bug. I have now reworked the |
Somehow I am getting intermittent tls errors such as
TLS failure: (Fatal MACMismatch)
orTLS failure: (Fatal (RecordOverflow 26678))
when usingtls-eio
in my repo: https://github.com/bikallem/ocaml-dns/tree/eio-tlsThis happens after I successfully establish tls connection - I can observe that I can do a successful tls handshake and can send application data over the tls connection. The first couple of data packets are sent and received okay however, it seems anything more than that seems to fail with the errors enumerated above. Could you please advise if I am using the tls-eio correctly?
The text was updated successfully, but these errors were encountered: