Openssl error with quick_cert code

Trying to get quick_cert working with JRuby 1.4. The following code
bombs out

keypair = OpenSSL::PKey::RSA.new(1024)
if new_certificate_opts[:password].nil? then
  File.open @keypair_file, "w", 0400 do |f|  # 0400 = 000 100 000

000 owner read only ??
f << keypair.to_pem
end
else
passwd_cb = proc do
new_certificate_opts[:password]
end
cipher = OpenSSL::Cipher::DES.new(:EDE3, :CBC)
keypair_export = keypair.export(cipher,
new_certificate_opts[:password]) <<<< fails on this line

------error-------------------------------------------------------------
org/jruby/ext/openssl/x509store/PEMInputOutput.java:730:in
writeRSAPrivateKey': java.io.IOException: unknown algorithm in write_DSAPrivateKey (NativeException) from org/jruby/ext/openssl/PKeyRSA.java:418:inexport’
from sun/reflect/NativeMethodAccessorImpl.java:-2:in invoke0' from sun/reflect/NativeMethodAccessorImpl.java:39:ininvoke’
from sun/reflect/DelegatingMethodAccessorImpl.java:25:in
invoke' from java/lang/reflect/Method.java:597:ininvoke’
from
org/jruby/internal/runtime/methods/ReflectedJavaMethod.java:145:in
call' from org/jruby/internal/runtime/methods/DynamicMethod.java:188:incall’
from
org/jruby/internal/runtime/methods/DynamicMethod.java:184:in `call’

Anyone able to offer any advice?

Thanks
Paul F Fraser


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

If you can reduce this to something we can run, even if it requires an
external library (though only depending on OpenSSL is ideal) it would
help. And you should file a bug too :slight_smile:

On Wed, Nov 18, 2009 at 10:30 PM, Paul F Fraser [email protected]
wrote:

  passwd_cb = proc do
   from org/jruby/ext/openssl/PKeyRSA.java:418:in `export’


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charles Oliver N. wrote:

If you can reduce this to something we can run, even if it requires an
external library (though only depending on OpenSSL is ideal) it would
help. And you should file a bug too :slight_smile:

Charlie,
Bug jruby-4272 submitted
Paul


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email