Skip to content

Instantly share code, notes, and snippets.

@nahi
Created April 15, 2010 15:04
Show Gist options
  • Save nahi/367188 to your computer and use it in GitHub Desktop.
Save nahi/367188 to your computer and use it in GitHub Desktop.
diff --git a/src/java/org/jruby/ext/openssl/x509store/Lookup.java b/src/java/org
/jruby/ext/openssl/x509store/Lookup.java
index 0b622a0..787c16b 100644
--- a/src/java/org/jruby/ext/openssl/x509store/Lookup.java
+++ b/src/java/org/jruby/ext/openssl/x509store/Lookup.java
@@ -27,11 +27,13 @@
***** END LICENSE BLOCK *****/
package org.jruby.ext.openssl.x509store;
+import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.InputStream;
import java.io.BufferedReader;
+import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.math.BigInteger;
@@ -267,6 +269,8 @@ public class Lookup {
try {
ChannelDescriptor descriptor = ChannelDescriptor.open(runtime.getCu
rrentDirectory(), file, new ModeFlags(ModeFlags.RDONLY));
return ChannelStream.open(runtime, descriptor).newInputStream();
+ } catch (NoSuchMethodError nsme) {
+ return new BufferedInputStream(new FileInputStream(file));
} catch (FileExistsException fee) {
// should not happen because ModeFlag does not contain CREAT.
fee.printStackTrace(System.err);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment