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
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 `’
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,
Maybe Process Monitor from Sysinternals Suite can help you follow
syscalls of the process and identify the issue.
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,
Maybe Process Monitor from Sysinternals Suite can help you follow
syscalls of the process and identify the issue.
Kind regards
robert
I don’t seems to understand, how in this context it can help me? can you
please explain bit more?
I don’t seems to understand, how in this context it can help me? can you
please explain bit more?
PM is capable of tracing all syscalls and recording them along with
arguments and return values IIRC. That way you often get a good idea
what a program does and what the source of such an error might be. Of
course this works only if the error has something to do with the
system and is not internally in program logic. I suspect your case
has to do with the system. That’s why I suggested this.
I’ve the same issue. Adding “rb” next to pfx_file name doesn’t work for
me. It gives, cannot convert string to integer as error. Can someone
please help me? I use windows 8.0 and ruby 1.9.3. How do I make sure
that I’ve installed openSSL?