EPFL-Net-SSLTest
view release on metacpan or search on metacpan
bin/epfl-net-ssl-test view on Meta::CPAN
}
if ( $host->ready() ) {
foreach my $endpoint ( $host->endpoints() ) {
if ( $endpoint->ready() ) {
print "\n", $endpoint->ip_address(), "\n"
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â Diode', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â SSL Certificate', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
if ( $endpoint->grade() eq 'A' or $endpoint->grade() eq 'A+' ) {
print color('green'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
else {
print color('red'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
}
else {
print "\n", color('red'), 'â Diode', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
checkLocalCertificate($domain);
}
}
}
else {
print "\n", color('red'), 'â ', $host->status_message(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
exit 1;
}
sub checkLocalCertificate {
my $dom = shift;
my $url = 'https://' . $dom;
my $ua = LWP::UserAgent->new;
my $request = HTTP::Request->new( HEAD => $url );
my $response = $ua->request($request);
if ( $response->is_error ) {
print color('red'), 'â SSL Certificate', "\n\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
}
if ( $response->is_success ) {
print color('green'), 'â SSL Certificate', "\n\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
}
return;
}
=head1 AUTHOR
William Belle, C<< <william.belle at gmail.com> >>
=head1 BUGS AND LIMITATIONS
Please report any bugs or feature requests here
L<https://github.com/epfl-idevelop/epfl-net-sslTest/issues>.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc EPFL::Net::SSLTest
You can also look for information at:
=over 4
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/EPFL-Net-SSLTest>
=item * CPAN Ratings
L<https://cpanratings.perl.org/d/EPFL-Net-SSLTest>
=item * Search CPAN
L<https://metacpan.org/release/EPFL-Net-SSLTest>
=back
=head1 LICENSE AND COPYRIGHT
Copyright ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
L<http://www.apache.org/licenses/LICENSE-2.0>
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
( run in 0.852 second using v1.01-cache-2.11-cpan-39bf76dae61 )