bug#70645: Reliable HTTPS networking

Christopher Baines <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Christopher Baines <[email protected]> writes:

> For years now I've been trying to work out how to do reliable HTTPS
> networking with Guile, where reliable just means that it can't hang
> indefinitely.
>
> After a few wrong turns, I believe the way to do this is use
> non-blocking ports as that combined with suspendable ports in Guile
> allows you to provide current-read-waiter/current-write-waiter
> procedures that will timeout at some point.
>
> I think the final hurdle is to get tls-wrap in (web client) to support
> Asynchronous operation with GnuTLS [1] and I think there are only a
> couple of things missing. make-session needs passing
> connection-flag/nonblock and error/again plus error/interrupted
> exceptions need handling for the handshake using the information from
> record-get-direction about whether Guile should wait to write or read.
>
> 1: https://gnutls.org/manual/html_node/Asynchronous-operation.html
>
> I think I forgot to move things forward after guile-gnutls 4.0.0
> released with record-get-direction, so I'm opening this bug to try and
> keep track of things.

I've now sent a couple of patches.

The first is a re-send of [2], but with some docstring improvements. I
can't find any reference in the Guile docs at least to the bitwise
or'ing of options with the socket style, so while it seems to work, I'm
a bit unsure about that.

2: https://lists.gnu.org/archive/html/guile-devel/2023-07/msg00025.html

The second patch makes the changes inside of tls-wrap.

There's also this patch [3] here to make get-bytevector-all
non-blocking, and that's relevant here as it's used in
read-response-body.

3: https://lists.gnu.org/archive/html/guile-devel/2023-07/msg00023.html
signature.asc (application/pgp-signature, 987 B)
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmYvjPxfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XdT4g/+J/fQ1b/uNPXq4EULmQ4x7RWhdkW+7HCL
1Eq4R29f886lcB2lcKyg8/t9Epd89FESg7GQDbY5qJB23gCyoccmA0wRLmRBAhIq
VZo9Ftkqe4CEnCRl7ngghiadv9ncUtoF2ZvfQrsP8u1Dqf948z1YVSmkyUrdfi6e
NPtiPXLOdKSRBYkBGaURCOLpgTPCTtJ3BZWQoCxIFZcGJ4saajp5ykbKMDhgJPsh
UovVYGwljPIpPcp4MhWMPd6uSwo6QWqjW2zeMLRt7NYgYdtWzOt3Bfe60jQ7cykI
Zhr51SknuL1xIe+DTUNANHaWIDPo4GCNVTp8MEZorlL59EC4u2gvnOZQaZJhIoip
/zoB7C94CgtvWFsk2e+7/5HLALYYP7uiSq5hzggBeoxwG+58J6xyxOxap7bOg950
Oixj75PSZkHEnVCa+C50Fo2cYURLorp0/iymnjOp8klPRfg2eQa28KE6Zqu3NGOi
1y1ZtLe5CvU5KMtDWIfUiuv2Z91ZPUcDc1DJWiBEUTNnLJi9urZoD/riB2RLdOcE
VNOOa85u6e2hpmIyq9hMJQ5gkym+cM/GcwWQeZ9+OzGSt0tGYE2WtW4HDYCAYgMy
Xpor39OsNRbqrZt+6PTe5hgB8RKjJZCMQbs15IhUbZiXqinAt/8p/ugzri+cnQFP
cIIJ1Yk6RIE=
=WnA5
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.