Skip to content

Commit

Permalink
Added a check that URL is a type of HTTPS uri.
Browse files Browse the repository at this point in the history
Relates to BZ 1405369
  • Loading branch information
Julian Cheal committed May 8, 2017
1 parent aeccf24 commit f20390a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/foreman/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def connect(options = {})
end

def verify_credentials(auth_type = nil, options = {})
uri = URI.parse(url) unless url.blank?
unless uri.kind_of?(URI::HTTPS)
raise "URL has to be HTTPS"
end
with_provider_connection(options.merge(:auth_type => auth_type), &:verify?)
rescue SocketError,
Errno::ECONNREFUSED,
Expand Down

0 comments on commit f20390a

Please sign in to comment.