Last active
August 29, 2015 14:10
-
-
Save jbarber/3146fc0403ee00e88cab to your computer and use it in GitHub Desktop.
Get LDAP TLS certificate in PEM format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Net::SSLeay qw(get_peer_certificate); | |
use Net::LDAP; | |
my $ldap = Net::LDAP->new("ldap.fe.up.pt") or die $!; | |
$ldap->start_tls or die $!; | |
$ldap->bind or die $!; | |
print Net::SSLeay::PEM_get_string_X509( | |
get_peer_certificate( | |
$ldap->certificate->_get_ssl_object | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment