Skip to content

Instantly share code, notes, and snippets.

@tempire
Created February 5, 2012 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tempire/1743111 to your computer and use it in GitHub Desktop.
Save tempire/1743111 to your computer and use it in GitHub Desktop.
my %options = (
SSL_startHandshake => 0,
SSL_error_trap => sub {
$self->_cleanup;
close delete $self->{handle};
$self->emit_safe(error => $_[1]);
},
SSL_cert_file => $args->{tls_cert},
SSL_key_file => $args->{tls_key},
SSL_ca_file => $args->{tls_ca}
&& -T $args->{tls_ca} ? $args->{tls_ca} : undef,
SSL_verify_mode => $args->{tls_ca} ? 0x01 : 0x00,
SSL_verify_callback => sub {
warn "\033[34m$_\033[37m: " . shift
for 'openssl opinion',
'c-style memory address',
'certification attributes',
'errors',
'c-style memory address of peer\'s own certificate';
},
Timeout => $timeout
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment