Skip to content

Fix operator when checking for Mozilla::CA error#29

Merged
oalders merged 1 commit intolibwww-perl:masterfrom
rwstauner:mozca-error
Sep 8, 2016
Merged

Fix operator when checking for Mozilla::CA error#29
oalders merged 1 commit intolibwww-perl:masterfrom
rwstauner:mozca-error

Conversation

@rwstauner
Copy link
Contributor

@rwstauner rwstauner commented May 21, 2016

I noticed a strange looking operator and figured it was a mistake.

I used this test to verify the change, but I'm not sure that you would want to add it to the dist:

#!/usr/bin/perl

use strict;
use warnings;
use Test::More;
use LWP::UserAgent;
use LWP::Protocol::https;

plan tests => 1;

{
  my $ua = LWP::UserAgent->new(
      ssl_opts => { verify_hostname => 1 }
  );
  local @INC; # so Mozilla::CA won't be found.
  local $_ = "Can't locate Mozilla/CA.pm";
  eval {
    LWP::Protocol::https->new(ua => $ua)->_extra_sock_opts;
  };
  like(
    $@,
    qr/Can't verify SSL peers without knowing which Certificate Authorities to trust/,
    'friendlier error message when missing Mozilla::CA'
  );
}

@oalders
Copy link
Member

oalders commented Jun 25, 2016

This looks good to me.

@oalders oalders merged commit 7746879 into libwww-perl:master Sep 8, 2016
@oalders
Copy link
Member

oalders commented Sep 8, 2016

BTW, the test looks good as well. If you want to add it, I'll merge it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants