From: Nauman Thanvi Date: 2012-04-22T16:35:47+09:00 Subject: Why openssl on windows produces error but not on centos to read pkcs12 Hi, Its been days trying to figure out what could be wrong, hence I need some one who already did tried to read pkcs12 certificate before. This is code which I'm using both on centos and windows, require 'openssl' if ARGV.length == 2 pkcs12 = OpenSSL::PKCS12.new(File.read(ARGV[0]), ARGV[1]) p pkcs12.certificate else puts "Usage: load_cert.rb " end Running this produces error on windows but not in linux/cygwin Error: OpenSSL::PKCS12::PKCS12Error: PKCS12_parse: mac verify failure from (irb):21:in initialize' from (irb):21:innew' from (irb):21 from C:/Ruby192/bin/irb:12:in `' This has been so frustrating, that I tried to produce own certificate own windows then tried again but it gives same error I did these steps - Use this software to create certificates http://xca.sourceforge.net/ - Exported UserCert2.crt, ruby reads correctly crt = File.read "UserCert2.crt" irb(main):018:0> certificate = OpenSSL::X509::Certificate.new crt => # - Exported to usercert.p12, ruby gives same error OpenSSL::PKCS12::PKCS12Error: PKCS12_parse: mac verify failure from (irb):21:in initialize' from (irb):21:innew' from (irb):21 from C:/Ruby192/bin/irb:12:in `' Thanks in advance for any clue or help, Nauman -- Posted via http://www.ruby-forum.com/.