Use IO::Wait{Readable,Writable} instead of inspecting error messages
Fix the SSL certificate generation in the integration test to work in JRuby