Is it possible to connect to an API with SSL certificates, with Net::HTTP::Spore?

18 views
Skip to first unread message

Pierre M

unread,
Dec 1, 2013, 11:03:03 AM12/1/13
to spore...@googlegroups.com
Hi, I want to connect to an API with a SSL certificate.
I'm guessing that it's not possible, because Net::HTTP::Spore uses HTTP::Request, which doesn't do this kind of thing. Is that right?

If so, is there a workaround?


--- Pierre Masci

Pierre M

unread,
Dec 1, 2013, 11:32:49 AM12/1/13
to spore...@googlegroups.com
I managed, by looking at the internals of REST::Client and Net::HTTP::Spore::Role::UserAgent.

I could document it and send a pull request. Shall I?

--- Pierre Masci
I check email a couple times daily; to reach me sooner, you can send me a text message via this page: https://awayfind.com/mascip

Pierre M

unread,
Dec 1, 2013, 11:33:27 AM12/1/13
to spore...@googlegroups.com
PS: the solution is:
$client->api_useragent->ssl_opts(SSL_cert_file => '/usr/lib/ssl/client-2048.crt');
$client->api_useragent->ssl_opts(SSL_key_file  => '/usr/lib/ssl/client-2048.key');

--- Pierre Masci
I check email a couple times daily; to reach me sooner, you can send me a text message via this page: https://awayfind.com/mascip


Reply all
Reply to author
Forward
0 new messages