Fork me on GitHub
#babashka
<
2023-07-23
>
dabrazhe15:07:05

Another personal bb story. I needed an http client in clj, something more elaborate than (slurp "http://bb.bb"), It also works for basic requests, but not when you need to bypass SSL checks for insecure endpoints. Someone here pointed out the http-client lib, which works with bb as a dependency. Here is how to make an insecure https request, ignoring ssl alarm bells. I'd tried the following code and bang!, alas, there was an SSL exception, which I mentioned in the Slack thread. I was already compiling in my head how to use the bb-shell to make requests with curl ... -k. But the events took an unexpected turn.

[babashka.http-client :as http])
(def client (http/client
             {:ssl-context (http/->SSLContext {:insecure true})}))
(def resp (http/post "" {:client client}))
@borkdude, alert as ever, pointed out that this bug has been fixed in the new version which I tried and voila it worked! I can't help being impressed with Michiel's reaction speed and quickness of mind, like a magician having answers to all kinds of pesky questions right up his sleeve whenever I ask!

❤️ 6
🙌 8
2