Skip to content

Commit

Permalink
Merge pull request #92 from nov/fix/mtls_on_faraday
Browse files Browse the repository at this point in the history
changes for mTLS on faraday
  • Loading branch information
nov authored Oct 8, 2022
2 parents 51b76fe + 8943b41 commit bff3cb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rack/oauth2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def self.http_client(agent_name = "Rack::OAuth2 (#{VERSION})", &local_http_confi
Faraday.new(headers: {user_agent: agent_name}) do |faraday|
faraday.request :url_encoded
faraday.request :json
faraday.response :logger, Rack::OAuth2.logger if debugging?
faraday.response :logger, Rack::OAuth2.logger, {bodies: true} if debugging?
faraday.adapter Faraday.default_adapter
local_http_config&.call(faraday)
http_config&.call(faraday)
Expand Down
4 changes: 2 additions & 2 deletions lib/rack/oauth2/access_token/mtls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class MTLS < Bearer
def initialize(attributes = {})
super
self.token_type = :bearer
httpclient.ssl_config.client_key = private_key
httpclient.ssl_config.client_cert = certificate
httpclient.ssl.client_key = private_key
httpclient.ssl.client_cert = certificate
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/rack/oauth2/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def authenticated_context_from(*args)
params.merge!(
client_id: identifier
)
http_client.ssl_config.client_key = private_key
http_client.ssl_config.client_cert = certificate
http_client.ssl.client_key = private_key
http_client.ssl.client_cert = certificate
else
params.merge!(
client_id: identifier,
Expand Down

0 comments on commit bff3cb7

Please sign in to comment.