unixcharles / acme-client

A Ruby client for the letsencrypt's ACME protocol.
MIT License
495 stars 116 forks source link

Upgrading 2.0.5 -> 2.0.11, Why remove JSON.parse from 'fetch_directory'? #217

Closed sw4d closed 1 year ago

sw4d commented 1 year ago

Howdy.

I'm trying to upgrade from acme-client 2.0.5 to 2.0.11. I'm presently using Ruby 2.7.5 and Faraday 1.4.1. My intention is to upgrade to Ruby 3.0.4 once I get my tests passing.

A few of my tests started failing and I've tracked the issue potentially to the removal of the last line of this method: https://github.com/unixcharles/acme-client/blob/aeabe44fa1fa9f83dc4e4abd45485874eb1fa0e1/lib/acme/client/resources/directory.rb#L70 This method used to return a Hash of the response.body.

The new version: https://github.com/unixcharles/acme-client/blob/f6ba70a69c40f85ac9cccaf39c01469a57703783/lib/acme/client/resources/directory.rb#L70 returns a String and the load_directory method does not seem to interpret this new value as expected.

I could be missing something. I don't drill into gems very often.

sw4d commented 1 year ago

Another update on this, I forked the acme-client repo and tried playing around with the master branch.

I can see that on the master branch response.body comes back as a HASH... which explains why JSON.parse was dropped in the latest version of the acme-client gem. This works whether I'm using Faraday 1 or 2.

I think my project's tests are having trouble due to other faraday related gems I've got... (I'm looking at you faraday_middleware).

I've got enough information to close this ticket.