Skip to content

Allow openssl conduit-lwt-unix users to control their client Ssl.contexts#389

Closed
lippirk wants to merge 1 commit into
mirage:masterfrom
lippirk:ssl-context
Closed

Allow openssl conduit-lwt-unix users to control their client Ssl.contexts#389
lippirk wants to merge 1 commit into
mirage:masterfrom
lippirk:ssl-context

Conversation

@lippirk
Copy link
Copy Markdown

@lippirk lippirk commented Apr 23, 2021

I am making this patch because I'd like to be able to control the
lifetime of my openssl client context directly.

Motivation for this includes the fact that the global
Conduit_lwt_unix_ssl.Client.default_ctx is not sufficient in the case
that you want to update an ssl context's verify location (it is
necessary to use a new ssl context).

Example usage with cohttp:

(* three types of context :D *)
let client_ssl_context : Ssl.context = Conduit_lwt_unix_ssl.Client.create_ctx () in
(* some ssl setup *)
let* (ctx : Conduit_lwt_unix.ctx) = Conduit_lwt_unix.init ~client_ssl_context () in
let ctx : Cohttp_lwt_unix.Client.ctx = Cohttp_lwt_unix.Client.custom_ctx ~ctx () in
let* _ = Cohttp_lwt_unix.Client.call ~ctx `POST ~body:"blah" uri in
...

…exts

I am making this patch because I'd like to be able to control the
lifetime of my openssl client context directly.

Motivation for this includes the fact that the global
`Conduit_lwt_unix_ssl.Client.default_ctx` is not sufficient in the case
that you want to update an ssl context's verify location (it is
necessary to use a new ssl context).

Example usage with cohttp:

```
(* three types of context :D *)
let client_ssl_context : Ssl.context = Conduit_lwt_unix_ssl.Client.create_ctx () in
(* some ssl setup *)
let* (ctx : Conduit_lwt_unix.ctx) = Conduit_lwt_unix.init ~client_ssl_context () in
let ctx : Cohttp_lwt_unix.Client.ctx = Cohttp_lwt_unix.Client.custom_ctx ~ctx () in
let* _ = Cohttp_lwt_unix.Client.call ~ctx `POST ~body:"blah" uri in
...
```
@lippirk
Copy link
Copy Markdown
Author

lippirk commented Apr 26, 2021

closing in favour of #390

@lippirk lippirk closed this Apr 26, 2021
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.

1 participant