chibi-scheme icon indicating copy to clipboard operation
chibi-scheme copied to clipboard

(chibi net http-client) does not seem to support HTTPS

Open Zambito1 opened this issue 2 years ago • 2 comments

> (http-get "http://httpbin.org")
#<Input-Port 140185626098688>
> (http-get "https://httpbin.org")
ERROR: couldn't retrieve url
    "https://httpbin.org"
    ("HTTP/1.1" 400 "Bad Request")

For any HTTP URL this seems to work, but for any HTTPS URL I receive the error shown. I believe this library should handle HTTPS without error.

I realize this is not the easiest task given the dependency on SSL. Perhaps a reasonable solution would be to probe the system for common HTTP clients (such as cURL) and offload HTTPS requests to that.

Zambito1 avatar Dec 22 '22 20:12 Zambito1

snow-chibi actually has an option to use curl.

Another option is (chibi ssl), an external library on snow-fort used by (chibi smtp). Without requiring it in the core, we could check for the presence of it and load it dynamically on https requests.

ashinn avatar Dec 22 '22 22:12 ashinn

Ah nice, I missed that library. I'm not sure how much effort that would take to do in a portable way. Another possibility could be to add a parameter object so the consumer can provide required SSL procedures. This would increase the complexity of using this library when using HTTPS, but I think it would be easier to implement and would likely be more flexible, since alternative SSL libraries could be used if desired.

Zambito1 avatar Dec 23 '22 15:12 Zambito1