serio:ty01pr00id00ex00
  "   ˆl–Ým_J*j"Tâ�jàY¸TÅ£Áƒh¹À¿      1
  "   ˆl–Ðz¾”êe¶… ¼ �q·®å1hßÂƒ|ÁÀ #x    (This quick reference list was contributed by anton@genua.de. Thanks, --Sampo)

Net::SSLeay - useful function prototypes


#----------------------------------
# Import frequently used functions
#----------------------------------

use Net::SSLeay qw(die_now die_if_ssl_error);

$errs = die_if_ssl_error($msg);
	Program dies with $msg if print_errs() was able to find and print 
	some errors.
	$errs is 0 if no error occurred.

die_now($msg);
	Program dies unconditionally! print_errs($msg) is used to print out 
	errors before dying.


#--------------------------
# Unsorted prototypes  
#--------------------------

$count = Net::SSLeay::print_errs($msg);
	Prints SSLeay-error stack with included $msg via 'warn'. Number of 
	printed	errors is returned (->$count).

void Net::SSLeay::randomize($seed_file,$seed_string);
void Net::SSLeay::randomize();
	Load random bytes from $seed_file and from string $seed_string.
	Also uses $Net::SSLeay::random_device and $Net::SSLeay::how_random 
	(Bits!) if used	without parameters.

void Net::SSLeay::RAND_seed($seed_string);
	Seeds randomgenerator with $seed_string.

$bytes_read = Net::SSLeay::RAND_load_file($file_name, $how_much);
	Loads $how_much bytes randomness from file $file_name.

$bytes_written = Net::SSLeay::RAND_write_file($file_name);
	Writes randomness to $file_name.

void Net::SSLeay::load_error_strings();
	Load SSL error messages to make error output more informative.

void Net::SSLeay::ERR_load_crypto_strings();
	Load crypto-API related error messages.
 
void Net::SSLeay::SSLeay_add_ssl_algorithms();
	Add support for supported ciphers.

void Net::SSLeay::ENGINE_load_builtin_engines
	Load any built-in SSL engines suported by the underlybing OpenSSL

void Net::SSLeay::ENGINE_register_all_complete
	Register any built-in SSL engines

$ctx = Net::SSLeay::CTX_new();
	Creates SSL-context. 

int Net::SSLeay::CTX_set_default_verify_paths($ctx);
	Load default location where to find certificates to verify
	remote certificates. This value is precompiled in SSLeay-Toolkit.

int Net::SSLeay::CTX_load_verify_locations($ctx, $cert_file, $cert_dir);
	Set verify location. File with certificates or hashed directory.

void Net::SSLeay::CTX_set_verify($ctx, $mode , \&verify_cb);
	Set mode and callback what to do with remote certificates.
	$mode:	
		&Net::SSLeay::VERIFY_NONE
		&Net::SSLeay::VERIFY_PEER
		&Net::SSLeay::VERIFY_FAIL_IF_NO_PEER_CERT
		&Net::SSLeay::VERIFY_CLIENT_ONCE
	\&verify_cb: 
		$ok = verify_cb($ok,$x509_store_ctx);
		Callback gets info if SSL-toolkit verified certificate ($ok) 
		and certificate store location.
	
void Net::SSLeay::CTX_set_default_passwd_cb($ctx,\&passwd_cb);
	If our RSA private key is passphrase protected and this callback is
	defined, then do not ask on the terminal but call the function.
	\&passwd_cb:
		$passwd = verify_cb($verify);
		If $verify is true, then the callback is supposed to make sure
		the returned password has been verified.

$bool = Net::SSLeay::CTX_use_certificate_file($ctx,$cert,$type);
$bool = Net::SSLeay::CTX_use_PrivateKey_file($ctx,$key,$type);
	Functions to load cert/key from filename ($cert/$key) with filetype 
	$type into SSL-context. 
	Filetypes are:
		&Net::SSLeay::FILETYPE_PEM

$ssl = Net::SSLeay::new($ctx)
	Creates a SSL-session in context $ctx. Returns 0 on failure.

$bool = Net::SSLeay::use_certificate_file($ssl,$cert,$type);
$bool = Net::SSLeay::use_RSAPrivateKey_file($ssl,$key,$type);
	Functions to load cert/key from filename ($cert/$key) with filetype 
	$type into SSL-session. 
	Filetypes are:
		&Net::SSLeay::FILETYPE_PEM

$bool = Net::SSLeay::set_fd($ssl, fileno(S));
	Connect SSL-Toolkit with TCP-connection.
	$ssl	SSL-Session
	S	open socket
	$bool	0-failure 1-success
	
$bool = Net::SSLeay::accept($ssl);
	Make SSL-handshake on hot connection. I am server!
	$ssl	SSL-session
	$bool	0-failure 1-success

$bool = Net::SSLeay::connect($ssl);
	Make SSL-handshake on hot connection. I am client!
	$ssl	SSL-session
	