I have an application for creating online courses at a
university. A professor requests a course on server A.
Upon approval by the sysadmin, their data is XMLized and
transmitted to the appropriate course server with an
authorization code, where the XML is parsed and the course
is created. Right now I'm doing this with IO::Socket and
everything works great.
The problem is, now I want to create these courses on
servers running SSL instead of just HTTP. I would prefer to
use IO::Socket::SSL, and just create a secure socket instead
of an insecure one, keeping my code mostly the same. But I'm
having a very difficult time getting this to work, mostly
because I can't find documentation. What I would really
like is some example code of what it looks like to open a
secure socket, but also some back story to the process. The
error I keep getting is unable to create socket: No such file or directory
The code I'm using is
my $socket = IO::Socket::SSL->new(
PeerAddr => "$remote_host:$remote_port",
PeerPort => $remote_port,
Proto => "tcp",
SSL_verify_mode=>0x01
) or die "unable to create socket: $!\n";;
What file is it missing? Where can I find documentation
on the methods for IO::Socket::SSL (they aren't in the README)?
Should I give up and use LWP instead? Either way, I seem
to be missing something big regarding "having the certificate
of the site I'm trying to connect to" (I keep seeing references
to that, but I don't know how to do it.)
Any help is humbly and gratefully requested. Thank you.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.