forked from ManageIQ/manageiq-providers-amazon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ManageIQ#432 from NickLaMuro/monkey-patch-aws-sdk-…
…core-for-proxy-auth-fix Add patch to aws-sdk-core to fix auth bug
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
lib/patches/aws-sdk-core/seahorse_client_net_http_pool_patch.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Autoload the connection pool | ||
Seahorse::Client::NetHttp::ConnectionPool | ||
|
||
module Seahorse | ||
module Client | ||
module NetHttp | ||
class ConnectionPool | ||
def start_session endpoint | ||
|
||
endpoint = URI.parse(endpoint) | ||
|
||
args = [] | ||
args << endpoint.host | ||
args << endpoint.port | ||
args << http_proxy.host | ||
args << http_proxy.port | ||
args << (http_proxy.user && CGI::unescape(http_proxy.user)) | ||
args << (http_proxy.password && CGI::unescape(http_proxy.password)) | ||
|
||
http = ExtendedSession.new(Net::HTTP.new(*args.compact)) | ||
http.set_debug_output(logger) if http_wire_trace? | ||
http.open_timeout = http_open_timeout | ||
|
||
if endpoint.scheme == 'https' | ||
http.use_ssl = true | ||
if ssl_verify_peer? | ||
http.verify_mode = OpenSSL::SSL::VERIFY_PEER | ||
http.ca_file = ssl_ca_bundle if ssl_ca_bundle | ||
http.ca_path = ssl_ca_directory if ssl_ca_directory | ||
http.cert_store = ssl_ca_store if ssl_ca_store | ||
else | ||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | ||
end | ||
else | ||
http.use_ssl = false | ||
end | ||
|
||
http.start | ||
http | ||
end | ||
end | ||
end | ||
end | ||
end |