Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby-openssl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dea99346226f
Choose a base ref
...
head repository: jruby/jruby-openssl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 60b9adc6c917
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 21, 2015

  1. Copy the full SHA
    66ad53e View commit details
  2. Copy the full SHA
    60b9adc View commit details
Showing with 35 additions and 2 deletions.
  1. +1 −1 .travis.yml
  2. +2 −1 Rakefile
  3. +32 −0 src/test/ruby/ssl/test_ssl.rb
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ env:
- TEST_PROFILE=test-1.7.4
- TEST_PROFILE=test-1.7.13
- TEST_PROFILE=test-1.7.18
- TEST_PROFILE=test-1.7.21 # NOTE 1.7.22 has load-path issues - loads built-in openssl
- TEST_PROFILE=test-1.7.22
- TEST_PROFILE=test-9.0.1.0
- TEST_PROFILE=test-9.0.4.0

3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ namespace :integration do
end
loader = "ARGV.each { |f| require f }"
test_files = FileList['src/test/integration/*_test.rb'].to_a
ruby "-Ilib:. -e \"#{loader}\" #{test_files.map { |f| "\"#{f}\"" }.join(' ')}"
lib = [ 'lib' ]; lib << '.' if RUBY_VERSION > '2.2'
ruby "-I#{lib.join(':')} -e \"#{loader}\" #{test_files.map { |f| "\"#{f}\"" }.join(' ')}"
end
end
32 changes: 32 additions & 0 deletions src/test/ruby/ssl/test_ssl.rb
Original file line number Diff line number Diff line change
@@ -121,4 +121,36 @@ def test_ssl_version_tlsv1_2
end
end unless java6? # TLS1_2 is not supported by JDK 6

def test_read_nonblock_would_block
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true) do |server, port|
sock = TCPSocket.new("127.0.0.1", port)
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.connect

if defined? OpenSSL::SSL::SSLErrorWaitReadable
begin
ssl.read_nonblock(2)
fail 'read would block error not raised!'
rescue OpenSSL::SSL::SSLErrorWaitReadable => e
assert_equal 'read would block', e.message
end
else
begin
ssl.read_nonblock(2)
fail 'read would block error not raised!'
rescue => e
assert_equal 'read would block', e.message
end
end
if RUBY_VERSION > '2.2'
result = eval "ssl.read_nonblock(5, 'buff', exception: false)"
assert_equal :wait_readable, result
end
result = ssl.sysread_nonblock(5, :exception => false)
assert_equal :wait_readable, result

ssl.close
end
end

end