net-http icon indicating copy to clipboard operation
net-http copied to clipboard

net/http.rb - fixup session timeout logic for OpenSSL 3

Open MSP-Greg opened this issue 2 years ago • 2 comments

In OpenSSL 3, session.timeout may not allow negative values, although context.timeout can be negative. For more info see https://github.com/ruby/openssl/issues/703.

Since the code here is using session.timeout in a non-standard way, use context.timeout. If it's nil, use session.timeout. This allows the code to work with OpenSSL 3.2.0.

MSP-Greg avatar Nov 27 '23 18:11 MSP-Greg

I tested this locally without the two commits affecting the test.

In addition to this PR, commits 042faf74e77d786ff60dff81555f6ec4f21e77a9 & 58fc559bfcb30e55ecb4a0e36800f81fbcf10715 should be reverted, and PR #163 should be merged, which adds WIndows CI.

At present, the only simple way to test against OpenSSL 3.2.0 is to use a Windows Ruby master build, either head or ucrt.

MSP-Greg avatar Nov 27 '23 19:11 MSP-Greg

I just rebased and additionally: a) added Windows CI b) removed the 'omit' in test_session_reuse_but_expire.

The branch is at https://github.com/MSP-Greg/net-http/commits/00-timeout-windows/, and CI passed.

Windows Ruby head builds all use OpenSSL 3.2.1, Ruby 3.2 and 3.3 are using OpenSSL 3.2.0.

MSP-Greg avatar Apr 16 '24 03:04 MSP-Greg

Closing, see https://github.com/ruby/net-http/pull/178

MSP-Greg avatar Jul 11 '24 01:07 MSP-Greg