Net::SSLeay v.1.36

Advertisement
Advertisement

There is a related module called Net::SSLeay::Handle included in this distribution that you might want to use instead. It has its own pod documentation.Net::SSLeay is a Perl module that offers some high level convenience functions for accessing web pages on SSL servers (for symmetry, the same API is offered for accessing http servers, too), an sslcat() function for writing your own clients, and finally access to the SSL api of the SSLeay/OpenSSL package so you can write servers or clients for more complicated applications.For high level functions it is most convenient to import them into your main namespace as indicated in the synopsis.Case 1 demonstrates the typical invocation of get_https() to fetch an HTML page from secure server. The first argument provides the hostname or IP in dotted decimal notation of the remote server to contact. The second argument is the TCP port at the remote end (your own port is picked arbitrarily from high numbered ports as usual for TCP). The third argument is the URL of the page without the host name part. If in doubt consult the HTTP specifications at http://www.w3c.org.Case 2 demonstrates full fledged use of get_https(). As can be seen, get_https() parses the response and response headers and returns them as a list, which can be captured in a hash for later reference. Also a fourth argument to get_https() is used to insert some additional headers in the request. make_headers() is a function that will convert a list or hash to such headers. By default get_https() supplies Host (to make virtual hosting easy) and Accept (reportedly needed by IIS) headers.Case 2b demonstrates how to get a password protected page. Refer to the HTTP protocol specifications for further details (e.g. RFC-2617).Case 3 invokes post_https() to submit a HTML/CGI form to a secure server. The first four arguments are equal to get_https() (note that the empty string ('') is passed as header argument). The fifth argument is the contents of the form formatted according to CGI specification. In this case the helper function make_https() is used to do the formatting, but you could pass any string. post_https() automatically adds Content-Type and Content-Length headers to the request.Case 4 shows the fundamental sslcat() function (inspired in spirit by the netcat utility :-). It's your swiss army knife that allows you to easily contact servers, send some data, and then get the response. You are responsible for formatting the data and parsing the response - sslcat() is just a transport.Case 5 is a full invocation of sslcat() which allows the return of errors as well as the server (peer) certificate.The $trace global variable can be used to control the verbosity of the high level functions. Level 0 guarantees silence, level 1 (the default) only emits error messages.SYNOPSIS use Net::SSLeay qw(get_https post_https sslcat make_headers make_form); ($page) = get_https('www.bacus.pt', 443, '/'); # 1 ($page, $response, %reply_headers) = get_https('www.bacus.pt', 443, '/', # 2 make_headers(User-Agent => 'Cryptozilla/5.0b1', Referer => 'https://www.bacus.pt' )); ($page, $result, %headers) = # 2b = get_https('www.bacus.pt', 443, '/protected.html', make_headers(Authorization => 'Basic ' . MIME::Base64::encode("$user:$pass",'')) ); ($page, $response, %reply_headers) = post_https('www.bacus.pt', 443, '/foo.cgi', '', # 3 make_form(OK => '1', name => 'Sampo' )); $reply = sslcat($host, $port, $request); # 4 ($reply, $err, $server_cert) = sslcat($host, $port, $request); # 5 $Net::SSLeay::trace = 2; # 0=no debugging, 1=ciphers, 2=trace, 3=dump data

There is a related module called ... Perl extension for using OpenSSL ...

 
  • Freeware
  • 143 Kb
  • 182
  • Free
 
 

Review Net::SSLeay

  • captcha
 
 
New Miscellaneous software
  • The .Net PDF Library  v.2019.8.9A .NET PDF library such as Iron PDF is a software library for C#, VB.NET, and other .NET Framework developers to work with PDFs generating PDFs, editing PDFs, and extracting PDF content within their applications. Supports .Net Core & .Net Framework.
  • HelpNDoc  v.6.6.0.444Full-featured help authoring tool, easy and powerful, producing HTML help files, CHM, PDF, Word, iPhone, ePub, Kindle and QtHelp documentation from a single source. Write help topics in the built-in word processor, hit the Generate button: it's done!
  • UninsHs  v.3.1.0.344This extension for Inno Setup allows you to easily add 'Repair/Modify/Remove' options to your installed applications. It is very small and use the .iss file, the .exe file is not required.
  • ModCom  v.12.2Free Windows software for Data Acquisition & Control, HMI / SCADA, Industrial Automation, Process Control, and Data Logging. Read data from sensors, turn on/off electrical equipment, output control voltages, count or time events, move stepper motors.
  • Eagle Mode for linux  v.0.83.0Eagle Mode is an advanced solution for a futuristic style of man-machine communication.
  • StoneageHTML  v.0.2.1Stone-Age HTML Filter: prepare documents for e-mail distribution ...