ruby - Pass arbitrary connection options to Farday -
i'm trying convert project have using excon
faraday
excon
adapter, i'm not having luck.
the issue need pass through arbitrary connection options excon
api interfacing uses client side ssl certs authentication.
to make connection straight excon
using this:
@connection = excon.new("some_url", client_cert: file.expand_path(@some_cert), client_key: file.expand_path(@some_key))
according faraday documention, should able this:s
@connection = faraday::connection.new(url: "some_url", client_cert: file.expand_path(@some_cert), client_key: file.expand_path(@some_key)) |faraday| faraday.adapter :excon end
when try (with 0.9 rc5 github), undefined method client_cert=
error, leads me believe documentation out of date. know how pass arbitrary connection options through adapter?
you have pass ssl options hash. should work:
ssl_opts = { client_cert: file.expand_path(@some_cert), client_key: file.expand_path(@some_key) } @connection = faraday::connection.new(url: "some_url", ssl: ssl_opts) |faraday| faraday.adapter :excon end
this gist has more examples using ssl faraday.
Comments
Post a Comment