Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for chained client certificates? #1576

Closed
Deekor opened this issue Jul 25, 2024 · 6 comments
Closed

Support for chained client certificates? #1576

Deekor opened this issue Jul 25, 2024 · 6 comments

Comments

@Deekor
Copy link

Deekor commented Jul 25, 2024

Basic Info

An API I'm using requires the use of certificate based auth and the certificates must be chained.

Ive been able to get it to work via bare bones net::http

@chained = OpenSSL::X509::Certificate.load(File.read("/path/chained.pem")) # reads a file that has 2 certs in it and returns an array of certs
url = URI("https://apiendpoin.com")

http = Net::HTTP.new(url.host, url.port)
http.cert = @chained.first
http.extra_chain_cert = @chained

http.key = @key
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request.body = "grant_type=client_credentials"

response = http.request(request)

I would love to use faraday, but it seems the ssl options only allow for one client_cert and not an array of certs and OpenSSL::X509::Certificate.new(File.read("/path/chained.pem")) only returns the first cert in chained.pem

@Deekor Deekor changed the title Support for chained certificates? Support for chained client certificates? Jul 25, 2024
@yykamei
Copy link
Contributor

yykamei commented Jul 26, 2024

I love the idea to support chained client certificates 😄 This issue is being also discussed here.

@iMacTia
Copy link
Member

iMacTia commented Aug 20, 2024

@Deekor @yykamei this was implemented in lostisland/faraday-net_http#42 and is available in the latest version of the faraday-net_http adapter 🎉

@iMacTia iMacTia closed this as completed Aug 20, 2024
@bvogel
Copy link

bvogel commented Aug 26, 2024

Hi, any chance to cut a new faraday release so this can "officially" be used? Thank you so much.

@iMacTia
Copy link
Member

iMacTia commented Aug 26, 2024

Planning to cut a release soon, was waiting on #1582 to be merged as well 👍

@iMacTia
Copy link
Member

iMacTia commented Aug 26, 2024

Release just went out 🎉

@bvogel
Copy link

bvogel commented Aug 26, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants