Skip to content

Commit

Permalink
Merge pull request #25 from robur-coop/tls-1
Browse files Browse the repository at this point in the history
update to TLS 1.0 API changes
  • Loading branch information
hannesm authored Aug 28, 2024
2 parents e0ce59b + 9e404a8 commit 9cb951c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions http-lwt-client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ depends: [
"base64" {>= "3.1.0"}
"faraday-lwt-unix"
"httpaf" {>= "0.7.0"}
"tls" {>= "0.16.0"}
"tls-lwt" {>= "0.16.0"}
"tls" {>= "1.0.0"}
"tls-lwt" {>= "1.0.0"}
"ca-certs"
"fmt"
"bos"
Expand Down
8 changes: 4 additions & 4 deletions src/http_lwt_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ let request
| None -> Lazy.force default_auth
| Some a -> Ok a
in
Result.map
(fun authenticator ->
`Default (Tls.Config.client ~alpn_protocols ~authenticator ()))
auth)
let ( let* ) = Result.bind in
let* authenticator = auth in
let* cfg = Tls.Config.client ~alpn_protocols ~authenticator () in
Ok (`Default cfg))
in
if not follow_redirect then
single_request happy_eyeballs ?config tls_config ~meth ~headers ?body uri f f_init
Expand Down
4 changes: 2 additions & 2 deletions src/http_lwt_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ module Make (Runtime : RUNTIME) = struct
fun vs ->
let cs =
List.map (fun { Faraday.buffer ; off ; len } ->
Cstruct.of_bigarray ~off ~len buffer) vs
Bigstringaf.substring ~off ~len buffer) vs
in
Lwt.catch (fun () ->
Tls_lwt.Unix.writev t cs >|= fun () ->
`Ok (Cstruct.lenv cs))
`Ok (List.fold_left (+) 0 (List.map String.length cs)))
(fun exn ->
Log.err (fun m -> m "exception writev: %s" (Printexc.to_string exn));
Tls_lwt.Unix.close t >|= fun () ->
Expand Down

0 comments on commit 9cb951c

Please sign in to comment.