Skip to content

Add an unix implementation of TLS using Unix.file_descr#443

Closed
dinosaure wants to merge 2 commits intomirleft:mainfrom
dinosaure:unix
Closed

Add an unix implementation of TLS using Unix.file_descr#443
dinosaure wants to merge 2 commits intomirleft:mainfrom
dinosaure:unix

Conversation

@dinosaure
Copy link
Copy Markdown
Contributor

@dinosaure dinosaure commented Dec 30, 2021

This PR is a draft because I missed key_update and reneg. Currently, the implementation follows tls-mirage as much as possible and the diff between them is smaller as I can. The resulted interface follows Mirage_flow.S without 'a Lwt.t to smoothly use it into some others MirageOS projects (such as colombe or dns).

  • key_update
  • reneg
  • client_of_flow should do the connect

@dinosaure dinosaure marked this pull request as ready for review January 3, 2022 17:00
@dinosaure
Copy link
Copy Markdown
Contributor Author

An other possibility is to abstract the underlying flow such as:

type 'flow Tls_unix.flow

type 'flow fully_write = 'flow -> string -> int -> int -> unit
type 'flow read = 'flow -> [ `Data of string | `Eof ]

val client_of_flow : fully_write:'flow fully_write -> read:'flow read -> Tls.Config.client -> ?host:[ `host ] Domain_name.t ->
  'flow -> ('flow flow, error) result

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Aug 20, 2024

Nearly 3 years later, what should we do with this? I know there (is/was) a similar module in https://github.com/cfcs/ofetch/

@reynir
Copy link
Copy Markdown
Contributor

reynir commented Aug 22, 2024

With #503 merge I guess this can be closed?

@dinosaure
Copy link
Copy Markdown
Contributor Author

With #503 merge I guess this can be closed?

It's more to do with the Unix module only. I don't have a problem with keeping this PR open: it's just that I've found myself several times having to make this module for different cases in which I didn't want to use a scheduler. Maybe the best thing (if you're not a maniac about open PRs) is to leave this PR open as an example.

@reynir
Copy link
Copy Markdown
Contributor

reynir commented Aug 22, 2024

Ah ok. I was just going off the comment in #503:

#443 rebased with string.

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Aug 22, 2024

Ah ok. I was just going off the comment in #503:

#443 rebased with string.

Thanks for spotting the typo, it was supposed to read #494 instead of #443 I assume.

@kit-ty-kate
Copy link
Copy Markdown
Contributor

Would it be possible to update this PR? I'm willing to test it as an early adopter by replacing ssl by tls.unix in ocamldap as mentioned in #517

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Sep 26, 2025

thanks a lot, superseeded by #518

@hannesm hannesm closed this Sep 26, 2025
hannesm added a commit to hannesm/opam-repository that referenced this pull request Sep 26, 2025
CHANGES:

* Provide an implementation which uses the Unix module (distributed with OCaml),
  based on the miou-unix implementation
  (mirleft/ocaml-tls#518 mirleft/ocaml-tls#443 @kit-ty-kate @dinosaure, fixes mirleft/ocaml-tls#517)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants