We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7ba8c5d + 14e09fb commit 83a6b17Copy full SHA for 83a6b17
lib/net/http.rb
@@ -972,6 +972,12 @@ def do_start
972
private :do_start
973
974
def connect
975
+ if use_ssl?
976
+ # reference early to load OpenSSL before connecting,
977
+ # as OpenSSL may take time to load.
978
+ @ssl_context = OpenSSL::SSL::SSLContext.new
979
+ end
980
+
981
if proxy? then
982
conn_addr = proxy_address
983
conn_port = proxy_port
@@ -1019,7 +1025,6 @@ def connect
1019
1025
end
1020
1026
1021
1027
1022
- @ssl_context = OpenSSL::SSL::SSLContext.new
1023
1028
@ssl_context.set_params(ssl_parameters)
1024
1029
@ssl_context.session_cache_mode =
1030
OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT |
0 commit comments