CurlEx—HTTP get using the curl command line app

https://hexdocs.pm/curl_ex/readme.html

Motivation

I got frustrated with Unknown CA errors from Erlang. Meanwhile, curl works just fine with the sites in question:

I couldn’t find a working Elixir lib that uses curl. So I started this ultra-simple and naive (but tested) one.

Usage

iex(1)> CurlEx.get!("https://google.com")
"<html>...</html>"

Currently, Microsoft Edge / Windows is the supported custom User Agent:

iex(2)> CurlEx.get_with_user_agent!("https://google.com", :microsoft_edge_windows)
"<html>...</html>"
4 Likes

Try req. req | Hex

Req.get("https://grad.tamu.edu/") works fine over here.

1 Like

That’s because the server has since been reconfigured to send the missing intermediate CA. (curl fetches missing intermediate CA certificates using the URL in the AIA extension, but Erlang’s ssl does not, also when using Mint/req)

4 Likes

okay, good they got that reconfigured :slight_smile:

1 Like

Yep!

Pretty nice—they acted on it.