Class: Bundler::PersistentHTTP
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Bundler::Persistent::Net::HTTP::Persistent
|
Defined in: | lib/bundler/vendored_persistent.rb |
Constant Summary
Persistent::Net::HTTP::Persistent
- Inherited
Class Method Summary
Persistent::Net::HTTP::Persistent
- Inherited
.detect_idle_timeout | Use this method to detect the idle timeout of the host at |
.new | Creates a new |
Instance Attribute Summary
Persistent::Net::HTTP::Persistent
- Inherited
#ca_file | An SSL certificate authority. |
#ca_file= | Sets the SSL certificate authority file. |
#cert | |
#cert_store | An SSL certificate store. |
#cert_store= | Overrides the default SSL certificate store used for verifying connections. |
#certificate | This client’s |
#certificate= | Sets this client’s |
#debug_output | Sends debug_output to this |
#headers | Headers that are added to every request using |
#http_versions | Maps host:port to an HTTP version. |
#idle_timeout | Maximum time an unused connection can remain idle before being automatically closed. |
#keep_alive | The value sent in the Keep-Alive header. |
#key | |
#max_requests | Maximum number of requests on a connection before it is considered expired and automatically closed. |
#name | A name for this connection. |
#no_proxy | List of host suffixes which will not be proxied. |
#open_timeout | Seconds to wait until a connection is opened. |
#override_headers | Headers that are added to every request using |
#private_key | This client’s SSL private key. |
#private_key= | Sets this client’s SSL private key. |
#proxy= | Sets the proxy server. |
#proxy_uri | The URL through which requests will be proxied. |
#read_timeout | Seconds to wait until reading one block. |
#retry_change_requests | Enable retries of non-idempotent requests that change data (e.g. POST requests) when the server has disconnected. |
#reuse_ssl_sessions | By default SSL sessions are reused to avoid extra SSL handshakes. |
#socket_options | An array of options for |
#ssl_version | SSL version to use. |
#ssl_version= | SSL version to use. |
#verify_callback | SSL verification callback. |
#verify_callback= | SSL verification callback. |
#verify_mode | HTTPS verify mode. |
#verify_mode= | Sets the HTTPS verify mode. |
#generation | Current connection generation. |
#generation_key | Where this instance’s connections live in the thread local variables. |
#request_key | Where this instance’s request counts live in the thread local variables. |
#ssl_generation | Current SSL connection generation. |
#ssl_generation_key | Where this instance’s SSL connections live in the thread local variables. |
#timeout_key | Where this instance’s last-use times live in the thread local variables. |
Instance Method Summary
Persistent::Net::HTTP::Persistent
- Inherited
#can_retry? | Is the request |
#cleanup | Finishes all connections on the given |
#connection_close? | Workaround for missing |
#connection_for | Creates a new connection for |
#connection_keep_alive? | Workaround for missing |
#error_message | Returns an error message containing the number of requests performed on this connection. |
#escape |
|
#expired? | Returns true if the connection should be reset due to an idle timeout, or maximum request count, false otherwise. |
#finish | Finishes the |
#http_version | Returns the HTTP protocol version for |
#idempotent? | Is |
#normalize_uri | Adds “http://” to the String |
#pipeline | Pipelines |
#proxy_bypass? | Returns true when proxy should by bypassed for host. |
#proxy_from_env | Creates a URI for an HTTP proxy server from ENV variables. |
#reconnect | Forces reconnection of HTTP connections. |
#reconnect_ssl | Forces reconnection of SSL connections. |
#request | Makes a request on |
#reset | Finishes then restarts the |
#shutdown | Shuts down all connections for |
#shutdown_in_all_threads | Shuts down all connections in all threads. |
#ssl | Enables SSL on |
#start | Starts the |
#unescape |
|
#http_class, | |
#max_age | Deprecated in favor of |
#request_failed | Raises an Error for |
#request_setup | Creates a GET request if |
#ssl_cleanup | Finishes all connections that existed before the given SSL parameter |
Constructor Details
This class inherits a constructor from Bundler::Persistent::Net::HTTP::Persistent
Instance Method Details
#connection_for(uri)
[ GitHub ]# File 'lib/bundler/vendored_persistent.rb', line 22
def connection_for(uri) connection = super warn_old_tls_version_rubygems_connection(uri, connection) connection end
#warn_old_tls_version_rubygems_connection(uri, connection)
[ GitHub ]# File 'lib/bundler/vendored_persistent.rb', line 28
def warn_old_tls_version_rubygems_connection(uri, connection) return unless connection.use_ssl? return unless (uri.host || "").end_with?("rubygems.org") socket = connection.instance_variable_get(:@socket) return unless socket socket_io = socket.io return unless socket_io.respond_to?(:ssl_version) ssl_version = socket_io.ssl_version case ssl_version when /TLSv([\d\.]+)/ version = Gem::Version.new($1) if version < Gem::Version.new("1.2") Bundler.ui.warn \ "Warning: Your Ruby version is compiled against a copy of OpenSSL that is very old. " \ "Starting in January 2018, RubyGems.org will refuse connection requests from these " \ "very old versions of OpenSSL. If you will need to continue installing gems after " \ "January 2018, please follow this guide to upgrade: http://ruby.to/tls-outdated.", :wrap => true end end end