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

Update to latest X509, TCP and TLS APIs #228

Merged
merged 1 commit into from
Apr 23, 2021
Merged

Conversation

talex5
Copy link
Contributor

@talex5 talex5 commented Apr 21, 2021

@hannesm : I tried updating to the latest APIs, but now the tests are failing with:

TLS connection failed: (Error (NoConfiguredSignatureAlgorithm ()))

What do I need to do to fix that?

hannesm added a commit to hannesm/ocaml-tls that referenced this pull request Apr 22, 2021
pass signature algorithms from certificaterequest to the location where the
certificate is sent. reported by @talex5 in
mirage/capnp-rpc#228
hannesm added a commit to hannesm/ocaml-tls that referenced this pull request Apr 22, 2021
pass signature algorithms from certificaterequest to the location where the
certificate is sent. reported by @talex5 in
mirage/capnp-rpc#228
@hannesm
Copy link
Member

hannesm commented Apr 22, 2021

Thanks for your work on this @talex5. Indeed, tls 0.13.0 suffered from an issue "authentication with client certificates and TLS 1.3" that you ran into. I've a patch ready, and once x509 0.13.0 lands into opam repository, I'll cut a tls 0.13.1 release with this fixed.

The background story is that the TLS 1.3 handshake is different from earlier, especially with client authentication. If the server sends a CertificateRequet, this now must contain a list of accepted SignatureAlgorithms -- our ocaml-tls client implementation did not respect this list, and did not preserve it until the client certificate was to be sent. Now, with the new logic in tls 0.13.0 about SignatureAlgorithms (ECDSA & ED25519 support), this lead to an error. The fix is in hannesm/ocaml-tls@fa780d6.

@talex5
Copy link
Contributor Author

talex5 commented Apr 22, 2021

Ah, OK. Will this cause any problems mixing old and new versions? e.g. if a tls.0.8.0 client connects to a tls.0.13.1 server, or vice versa?

@hannesm
Copy link
Member

hannesm commented Apr 22, 2021

@talex5 no, this should be fine interoperability-wise (unless your 0.13.1 server has tightly configured signaturealgorithms not supported by the 0.8 client - such as "only accept ECDSA/ED25519 certificates").

hannesm added a commit to hannesm/ocaml-tls that referenced this pull request Apr 22, 2021
pass signature algorithms from certificaterequest to the location where the
certificate is sent. reported by @talex5 in
mirage/capnp-rpc#228
hannesm added a commit to hannesm/opam-repository that referenced this pull request Apr 22, 2021
CHANGES:

* Breaking: use deriving sexp_of instead of sexp. Constructing a state from
  a sexp has not been supported (lead to exception), and is now removed
  (mirleft/ocaml-tls#430 by @torinnd, continued in mirleft/ocaml-tls#431 by @hannesm)
* Bugfix: TLS 1.3 client authentication with certificate, client side. This
  used to work accidentally before 0.13.0 changed the signature algorithms
  handling, now the right signature algorithm (as requested by server) is used.
  (mirleft/ocaml-tls#431 @hannesm, @talex5 reported mirage/capnp-rpc#228)
* adapt to x509 0.13.0 and mirage-crypto-ec 0.10.0 changes (mirleft/ocaml-tls#431 @hannesm)
hannesm added a commit to hannesm/opam-repository that referenced this pull request Apr 22, 2021
CHANGES:

* Breaking: use deriving sexp_of instead of sexp. Constructing a state from
  a sexp has not been supported (lead to exception), and is now removed
  (mirleft/ocaml-tls#430 by @torinnd, continued in mirleft/ocaml-tls#431 by @hannesm)
* Bugfix: TLS 1.3 client authentication with certificate, client side. This
  used to work accidentally before 0.13.0 changed the signature algorithms
  handling, now the right signature algorithm (as requested by server) is used.
  (mirleft/ocaml-tls#431 @hannesm, @talex5 reported mirage/capnp-rpc#228)
* adapt to x509 0.13.0 and mirage-crypto-ec 0.10.0 changes (mirleft/ocaml-tls#431 @hannesm)
@hannesm
Copy link
Member

hannesm commented Apr 22, 2021

I opened talex5#1 on top of this PR which solves the issue you mention (as bonus it let's the test-mirage run successfully as well).

@talex5 talex5 changed the title WIP: Update to latest X509, TCP and TLS APIs Update to latest X509, TCP and TLS APIs Apr 23, 2021
@talex5 talex5 marked this pull request as ready for review April 23, 2021 08:04
@talex5 talex5 merged commit 2b3225a into mirage:master Apr 23, 2021
@talex5 talex5 deleted the api-changes branch April 23, 2021 08:22
talex5 added a commit to talex5/opam-repository that referenced this pull request Apr 27, 2021
…nix and capnp-rpc-lwt (1.1)

CHANGES:

- Update to latest X509, TCP and TLS APIs (@talex5 @hannesm mirage/capnp-rpc#228).

- Add `Service.fail_lwt` convenience function (@talex5 mirage/capnp-rpc#229).

- Remove confusing debug details from `call_for_value_exn` errors (@talex5 mirage/capnp-rpc#230).
  The hidden information is now logged (at debug level) instead.

- Configure TCP keep-alives for incoming connections, not just outgoing ones (@talex5 mirage/capnp-rpc#227).
  This is needed when the client machine crashes without resetting the connection.

- Include version number in opam license field (@talex5 mirage/capnp-rpc#226).
talex5 added a commit to talex5/opam-repository that referenced this pull request Apr 27, 2021
…nix and capnp-rpc-lwt (1.1)

CHANGES:

- Update to latest X509, TCP and TLS APIs (@talex5 @hannesm mirage/capnp-rpc#228).

- Add `Service.fail_lwt` convenience function (@talex5 mirage/capnp-rpc#229).

- Remove confusing debug details from `call_for_value_exn` errors (@talex5 mirage/capnp-rpc#230).
  The hidden information is now logged (at debug level) instead.

- Configure TCP keep-alives for incoming connections, not just outgoing ones (@talex5 mirage/capnp-rpc#227).
  This is needed when the client machine crashes without resetting the connection.

- Include version number in opam license field (@talex5 mirage/capnp-rpc#226).
talex5 added a commit to talex5/opam-repository that referenced this pull request Apr 27, 2021
…nix and capnp-rpc-lwt (1.1)

CHANGES:

- Update to latest X509, TCP and TLS APIs (@talex5 @hannesm mirage/capnp-rpc#228).

- Add `Service.fail_lwt` convenience function (@talex5 mirage/capnp-rpc#229).

- Remove confusing debug details from `call_for_value_exn` errors (@talex5 mirage/capnp-rpc#230).
  The hidden information is now logged (at debug level) instead.

- Configure TCP keep-alives for incoming connections, not just outgoing ones (@talex5 mirage/capnp-rpc#227).
  This is needed when the client machine crashes without resetting the connection.

- Include version number in opam license field (@talex5 mirage/capnp-rpc#226).
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

Successfully merging this pull request may close these issues.

2 participants