LightTCP-SSLclient

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

```

### With Certificate Pinning

```perl
my $client = LightTCP::SSLclient->new(dir => './certs');
my ($ok, $errors, $debug) = $client->connect('example.com', 443);

# First connection - save fingerprint
$client->fingerprint_save('./certs', 'example.com', 443, $fp, 1);

# Subsequent connections will auto-verify
$client->fingerprint_save('./certs', 'example.com', 443, $fp, 0);
```

### Verbose Debug Mode

```perl
my $client = LightTCP::SSLclient->new(verbose => 1);
my ($ok, $errors, $debug) = $client->connect('example.com', 443);

print "=== DEBUG ===\n";
print @$debug;
print "=== ERRORS ===\n";
print @$errors;
```

### Following Redirects

```perl
my ($code, $state, $headers, $body, $errors, $debug, $resp_code, $history)
    = $client->request_with_redirects('GET', '/old-page', host => 'example.com');

print "Final URL: $headers->{'content-location'} // $body\n" if $code == 200;

# Show redirect chain
for my $r (@$history) {
    print "$r->{code}: $r->{from} -> $r->{to}\n";
}
```

## Testing

```bash
# Run all tests
make test

# Run single test file
prove t/00_load.t

# Run with verbose output
prove -v t/01_constructor.t

# Run without building first
perl -I lib t/00_load.t
```

## Requirements

- Perl 5.8.1+
- `IO::Socket::SSL`
- `IO::Socket::INET`
- `MIME::Base64`
- `URI`

## License

This module is free software and may be modified and distributed under the same terms as Perl itself.



( run in 1.031 second using v1.01-cache-2.11-cpan-39bf76dae61 )