Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • c7b1687
  • /
  • perl
  • /
  • ssl_srvr.pl
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:419402f12b566e47d62bf048c6f84792b54adf6c
directory badge Iframe embedding
swh:1:dir:6fe9f7ebaafee609a988be3a56ecc53319a65256
ssl_srvr.pl
#!/usr/local/bin/perl

use ExtUtils::testlib;

use SSLeay;

$ssl_ctx=SSL::CTX->new("SSLv3");

$ssl_ctx->set_options("-info_callback" =>
	sub	{
		print STDERR $_[0]->state()."\n";
		}
	);

$ssl_ctx->use_PrivateKey_file("server.pem");

$conn="localhost:4433";
$conn=$ARGV[0] if $#ARGV >= 0;
$bio=BIO->new("connect");
$bio->hostname($conn) || die $ssl->error();

$ssl=$ssl_ctx->new_ssl;
$ssl->set_bio($bio);

(($ret=$ssl->connect()) > 0) || die $ssl->error();

(($ret=$ssl->write("GET / HTTP/1.0\r\n\r\n")) > 0) || die $ssl->error();

while (1)
	{
	$ret=$ssl->read($buf,10240);
	last if ($ret <= 0);
	print $buf;
	}

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top