Skip to content

Instantly share code, notes, and snippets.

@ryochin
Created January 15, 2014 07:10
Show Gist options
  • Save ryochin/8432098 to your computer and use it in GitHub Desktop.
Save ryochin/8432098 to your computer and use it in GitHub Desktop.
Net::Twitter::Lite: workaround for restricted SSL/TLS with API 1.1
use IO::Socket::SSL;
my $twitter = Net::Twitter::Lite::WithAPIv1_1->new(
consumer_key => $config->{consumer_key},
consumer_secret => $config->{consumer_secret},
access_token => $config->{access_token},
access_token_secret => $config->{access_token_secret},
apiurl => "https://api.twitter.com/1.1",
useragent_args => {
ssl_opts => {
verify_hostname => 0,
SSL_verify_mode => SSL_VERIFY_NONE,
},
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment