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

  • 72e1ac8
  • /
  • sslbio.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:fd80ad85843c4be0afe25755ae72b6944f8fc3c3
directory badge Iframe embedding
swh:1:dir:72e1ac845e1e2c2c3aa79ef56db7ae5647a322dc
sslbio.pl
#!/usr/local/bin/perl

use ExtUtils::testlib;

use SSLeay;

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

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

# create a ssl bio
$bssl=BIO->new("ssl");
$bssl->set_ssl($ssl_ctx->new_ssl()) || die $bssl->error();
$bssl->get_ssl->set_options("-connect_state") || die $ssl->error();

$bssl->set_callback(sub { printf "XXXXXXXXXXXXXXXXXXXXXX %d %s\n",$_[1],$_[0]->type; });

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

# push it in
$bssl->push($bio);

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

while (1)
	{
	$ret=$bssl->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