The manakai project

Web::Transport::DefaultCertificateManager

Default certificate manager

SYNOPSIS

  use Web::Transport::DefaultCertificateManager;
  $cm = Web::Transport::DefaultCertificateManager->new ({
    ca_cert => $ca_cert,
    cert => $cert,
    key => $key,
  });

DESCRIPTION

The Web::Transport::DefaultCertifcateManger module is a default certificate manager (see "CERTIFICATE MANAGER" in Web::Transport).

METHOD

Following methods are available:

$cm = Web::Transport::DefaultCertificateManager->new ({$name => $value, ...})

Create a certificate manager.

The first argument must be a hash reference, which can contain zero or more name/value pairs of the options.

The TLS implementation accepts two options for root CA certificates: CAfile (which is a path to certificate bundle file) and CApath (which is a path to certificate collection directory).

The ca_cert option value must be a bundle of root CA certificates in the PEM file format, as a string, or a Web::Transport::PKI::Certificate object. The value, if specified, is used as a on-the-fly generated CAfile file's content.

The ca_file option value must be a path to the root CA certificates in the PEM file format. The value, if specified, is used a CAfile.

If none of ca_cert and ca_file is specified, the root CA certificates maintained by Mozilla is used as CAfile.

Options cert, cert_file, key, and key_file can be specified. See AnyEvent::TLS for their semantics and possible values.

The certificate manager has no host-specific certificates for SNI-based selection.

$cm->prepare ($name => $value, ...)->then (sub { ... })
{$name => $value, ...} = $cm->to_anyevent_tls_args_sync
{$name => $value, ...} = $cm->to_anyevent_tls_args_for_host_sync

See "CERTIFICATE MANAGER" in Web::Transport.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2018-2020 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.