How to chain SSL certificates in Perl? -
perl newbie here. need chain intermediate ca x509 certificate client certificate.
net::ssleay::set_cert_and_key($ctx, $crt, $key); $bio = net::ssleay::bio_new_file("subca.crt", 'r'); $x509 = net::ssleay::pem_read_bio_x509($bio); net::ssleay::ctx_add_extra_chain_cert($ctx, $x509) , die_if_ssl_error("ctx_add_extra_chain_cert"); # dies here.
the certificate in pem format. can help?
edit: have found phone call "net::ssleay::pem_read_bio_x509()" returns 0, error condition.
this looking for:
net::ssleay::ctx_use_rsaprivatekey_file($ctx, $key, &net::ssleay::filetype_pem) , die_if_ssl_error("private key"); net::ssleay::ctx_use_certificate_chain_file($ctx, $crt) , die_if_ssl_error("ctx_use_certificate_chain_file");
$crt contains 2 certificates, first client certificate, followed intermediate one.
perl ssl
No comments:
Post a Comment