Skip to content
Snippets Groups Projects
Verified Commit 11130397 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Fix an assortment of connection issues

parent 77d089d9
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
...@@ -18,7 +18,7 @@ module Passwordstate ...@@ -18,7 +18,7 @@ module Passwordstate
@headers = DEFAULT_HEADERS @headers = DEFAULT_HEADERS
@auth_data = options.select { |k, _v| %i[apikey username password].include? k } @auth_data = options.select { |k, _v| %i[apikey username password].include? k }
@api_type = options.fetch(:api_type) if options.key? :api_type @api_type = options.fetch(:api_type) if options.key? :api_type
@timeout = options.fetch(:timeout, 0) @timeout = options.fetch(:timeout, 15)
end end
def logger def logger
......
...@@ -11,7 +11,9 @@ module Net ...@@ -11,7 +11,9 @@ module Net
password: password password: password
} }
@ntlm_auth_information[:domain] = domain unless domain.nil? @ntlm_auth_information[:domain] = domain unless domain.nil?
@ntlm_auth_options = {} @ntlm_auth_options = {
ntlmv2: true
}
@ntlm_auth_options[:workstation] = workstation unless workstation.nil? @ntlm_auth_options[:workstation] = workstation unless workstation.nil?
end end
end end
...@@ -59,7 +61,7 @@ module Passwordstate ...@@ -59,7 +61,7 @@ module Passwordstate
if challenge && res.code == '401' if challenge && res.code == '401'
type2 = Net::NTLM::Message.decode64 challenge type2 = Net::NTLM::Message.decode64 challenge
type3 = type2.response(req.ntlm_auth_information, req.ntlm_auth_options) type3 = type2.response(req.ntlm_auth_information, req.ntlm_auth_options.dup)
req['authorization'] = 'NTLM ' + type3.encode64 req['authorization'] = 'NTLM ' + type3.encode64
req.body_stream.rewind if req.body_stream req.body_stream.rewind if req.body_stream
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment