Sending .pfx file http request

Hi everyone, I have to integrate with an api the requires ssl certification. I have to send three files to the api to do the handshake. It requires a pemfile, a keyfile and a pfxfile. As far as I can tell I believe I can set the pem file and key file using erlangs ssl options http://erlang.org/doc/man/ssl.html#type-cert. but I am Having trouble sending the pfx file. I am using httposion, this is what my request looks like.

    res =
      HTTPoison.get(url, [{"Authorization", "Bearer my_token"}],
        ssl: [
          {:versions, [:"tlsv1.2"]},
          certfile: crt_path,
          keyfile: key_path,
          pfxPath: pfx_path
        ]
      )

When I run this request I get

 %HTTPoison.Error{
   id: nil,
   reason: {:options,
    {:socket_options,
     [
       pfxPath: "/Users/jacksobocinski/bowst/talent-management/_build/dev/lib/talent/priv/certs/hype_auth.pfx",
       packet_size: 0,
       packet: 0,
       header: 0,
       active: false,
       mode: :binary
     ]}}
 }}```

When I remove the pfx path the request works but the api doesn't let me in because I do not have the pfx file. I am open to using other libraries besides poison, any ideas?
2 Likes

A potential solution would be doing this in javascript and posting the data back to elixir, thoughts?

1 Like