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
  • /
  • s2.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:540ca7c8174a8c8c868218b3268a754c5f44de72
directory badge Iframe embedding
swh:1:dir:6fe9f7ebaafee609a988be3a56ecc53319a65256
s2.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";
		}
	);

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

$ssl=$ssl_ctx->new_ssl;
$sbio=BIO->new("ssl");
$sbio->set_ssl($ssl);
$ssl->set_options("-connect_state");

$bio=BIO->new("buffer");

$sbio->push($cbio);
$bio->push($sbio);

($bio->do_handshake() > 0) || die $bio->error();

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

$data="";
while ($_=$bio->getline())
	{
	if (/^Server:/)
		{
		print;
		last;
		}
	}

if ($bio->peek_error())
	{
	print "There was an error:".$ssl->error();
	}
print "exit\n";

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

back to top