Title: [1109] trunk/jopenssl: Fix for JRUBY-2913.
Revision
1109
Author
olabini
Date
2008-08-12 11:28:58 -0400 (Tue, 12 Aug 2008)

Log Message

Fix for JRUBY-2913. Make sure that the format string for cert dirs work

Modified Paths

Diff

Modified: trunk/jopenssl/src/java/org/jruby/ext/openssl/x509store/Lookup.java (1108 => 1109)


--- trunk/jopenssl/src/java/org/jruby/ext/openssl/x509store/Lookup.java	2008-08-12 14:30:11 UTC (rev 1108)
+++ trunk/jopenssl/src/java/org/jruby/ext/openssl/x509store/Lookup.java	2008-08-12 15:28:58 UTC (rev 1109)
@@ -514,7 +514,7 @@
                 int tp = iter.next();
                 int k = 0;
                 for(;;) {
-                    b.append(String.format("%s/%08lx.%s%d",new Object[]{cdir,new Long(h),postfix,new Integer(k)}));
+                    b.append(String.format("%s/%08x.%s%d",new Object[]{cdir,new Long(h),postfix,new Integer(k)}));
                     k++;
                     if(!(new File(b.toString()).exists())) {
                         break;

Modified: trunk/jopenssl/test/test_integration.rb (1108 => 1109)


--- trunk/jopenssl/test/test_integration.rb	2008-08-12 14:30:11 UTC (rev 1108)
+++ trunk/jopenssl/test/test_integration.rb	2008-08-12 15:28:58 UTC (rev 1109)
@@ -10,6 +10,7 @@
 rescue LoadError
 end
 require "test/unit"
+require 'net/https'
 
 class TestIntegration < Test::Unit::TestCase
   # JRUBY-2471
@@ -23,4 +24,20 @@
     p config
     DRb.start_service(nil, nil, config)
   end
+
+  # JRUBY-2913
+  # Warning - this test actually uses the internet connection.
+  # If there is no connection, it will fail.
+  def test_ca_path_name
+    uri = URI.parse('https://www.paypal.com')
+
+    http = Net::HTTP.new(uri.host, uri.port)
+    http.verify_mode = OpenSSL::SSL::VERIFY_PEER
+    http.ca_path = "./"
+    http.use_ssl = true
+
+    response = http.start do |s|
+      assert s.get(uri.request_uri).length > 0
+    end
+  end
 end
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to