GET / HTTP/1.0
Host: example.com
over a socket and that's already mostly working. Figure out TLS. Then you just have to do command line parsing and add the stuff you parsed into your request. GET / HTTP/1.0
Host: example.com
over a socket and that's already mostly working. Figure out TLS. Then you just have to do command line parsing and add the stuff you parsed into your request.Is this sarcasm? A joke?
Between the docs[1][2] and the examples[3] I was up and running using my own IO stack in a couple of evenings. If I had used the IO stack from the library it would have been very easy.
Another couple of evenings and I had it integrated with Windows' certificate store. In the end it wasn't very difficult to implement, but it was a bit more of a challenge figuring out the documentation and how it related to mbedTLS.
Definitely a rewarding experience, gave me some nice insights into the plumbing.
edit: Note, not trying to argue replacing libcurl is a weekend project!
[1]: https://mbed-tls.readthedocs.io/projects/api/en/latest/
[2]: https://mbed-tls.readthedocs.io/projects/api/en/latest/api/g...
[3]: https://github.com/Mbed-TLS/mbedtls/blob/development/program...
Othwerise for basic HTTP version, I'll use Fetch API that has TLS already figured out. https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
Even with just http(s), what you describe is just a tiny fraction of typical use cases, even if you ignore all the rarely used bits.