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 TLS 1.0 API changes #25

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading