Subject: | Problem with cert-chain in P12 |
Hey,
I probably found a bug with handling cert-chain embedded in *.p12 files - chained certs are not used by IO::Socket::SSL at all. However all is working fine, if I extract them with IO::Socket::SSL::Utils, write to a file (*.pem) and then specify this file through "SSL_ca_file". Example of code:
###############
my ( undef, undef, @chn ) = Net::SSLeay::P_PKCS12_load_file( $p12, 1, $key );
open( my $fh, '>', $ca_file ) or die $!;
print $fh map { PEM_cert2string( $_ ); } @chn;
close( $fh );
CERT_free( $_ ) for @chn;
###############
I found this on Windows platform, however it seems that things go in the same way on Linux Debian.
Ps. I've checked this only in the latest version of IO::Socket::SSL.