Codex

Net::SSLeay

Section: User Contributed Perl Documentation (3pm)

Updated: 2014-07-14

Index?action=index Return to Main Contents


NAME

Net::SSLeay - Perl extension for using OpenSSL

SYNOPSIS

use Net::SSLeay qw(get_https post_https sslcat make_headers make_form);

($page) = get_https('www.bacus.pt', 443, '/'); # Case 1

($page, $response, %reply_headers) = get_https('www.bacus.pt', 443, '/', # Case 2 make_headers(User-Agent => 'Cryptozilla/5.0b1', Referer => 'https://www.bacus.pt' ));

($page, $result, %headers) = # Case 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', '', # Case 3 make_form(OK => '1', name => 'Sampo' ));

$reply = sslcat($host, $port, $request); # Case 4

($reply, $err, $server_cert) = sslcat($host, $port, $request); # Case 5

$Net::SSLeay::trace = 2; # 0=no debugging, 1=ciphers, 2=trace, 3=dump data

Net::SSLeay::initialize(); # Initialize ssl library once

@]

DESCRIPTION

Net::SSLeay module contains perl bindings to openssl (<http://www.openssl.org>) library.

COMPATIBILITY NOTE: Net::SSLeay cannot be built with pre-0.9.3 openssl. It is strongly recommended to use at least 0.9.7 (as older versions are not tested during development). Some low level API functions may be available with certain openssl versions.

Net::SSLeay module basically comprise of:

High level functions for accessing web servers (by using HTTP/HTTPS):
Low level API (mostly mapped 1:1 to openssl's C functions):
Convenience functions (related to low level API but with more perl friendly interface):

There is also a related module called Net::SSLeay::Handle included in this distribution that you might want to use instead. It has its own pod documentation.

High level functions for accessing web servers

This module 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 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.

Basic set of functions

get_https:
post_https:
put_https:
head_https:
do_https:
sslcat:
https_cat:
make_form:
make_headers:

Case 1 (in SYNOPSIS) 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 (in SYNOPSIS) demonstrates full fledged use of . As can be seen, 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 is used to insert some additional headers in the request. is a function that will convert a list or hash to such headers. By default supplies (to make virtual hosting easy) and (reportedly needed by IIS) headers.

Case 2b (in SYNOPSIS) demonstrates how to get a password protected page. Refer to the HTTP protocol specifications for further details (e.g. RFC-2617).

Case 3 (in SYNOPSIS) invokes to submit a HTML/CGI form to a secure server. The first four arguments are equal to (note that the empty string ( ) is passed as header argument). The fifth argument is the contents of the form formatted according to CGI specification. Do not post UTF-8 data as content: use utf8::downgrade first. In this case the helper function is used to do the formatting, but you could pass any string. automatically adds and headers to the request.
Case 4 (in SYNOPSIS) shows the fundamental function (inspired in spirit by the 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 - is just a transport.
Case 5 (in SYNOPSIS) is a full invocation of which allows the return of errors as well as the server (peer) certificate.
The 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.

Alternate versions of high-level API

get_https3:
post_https3:
put_https3:
get_https4:
post_https4:
put_https4:

The above mentioned functions actually return the response headers as a list, which only gets converted to hash upon assignment (this assignment looses information if the same header occurs twice, as may be the case with cookies). There are also other variants of the functions that return unprocessed headers and that return a reference to a hash.

($page, $response, @headers) = get_https('www.bacus.pt', 443, '/'); for ($i = 0; $i < $#headers; $i+=2) { print "$headers[$i] = " . $headers[$i+1] . "\n"; }

($page, $response, $headers, $server_cert) = get_https3('www.bacus.pt', 443, '/'); print "$headers\n";

($page, $response, $headers_ref) = get_https4('www.bacus.pt', 443, '/'); for $k (sort keys %) { for $v (@{$$headers_ref}) { print "$k = $v\n"; } }

@]

All of the above code fragments accomplish the same thing: display all values of all headers. The API functions ending in ``3 return the headers simply as a scalar string and it is up to the application to split them up. The functions ending in ``4 return a reference to a hash of arrays (see perlref and perllol if you are not familiar with complex perl data structures). To access a single value of such a header hash you would do something like

Variants 3 and 4 also allow you to discover the server certificate in case you would like to store or display it, e.g.

($p, $resp, $hdrs, $server_cert) = get_https3('www.bacus.pt', 443, '/'); if (!defined($server_cert) || ($server_cert == 0)) { warn "Subject Name: undefined, Issuer Name: undefined"; } else { warn 'Subject Name: ' . Net::SSLeay::X509_NAME_oneline( Net::SSLeay::X509_get_subject_name($server_cert)) . 'Issuer Name: ' . Net::SSLeay::X509_NAME_oneline( Net::SSLeay::X509_get_issuer_name($server_cert)); }

@]

Beware that this method only allows after the fact verification of the certificate: by the time has returned the https request has already been sent to the server, whether you decide to trust it or not. To do the verification correctly you must either employ the OpenSSL certificate verification framework or use the lower level API to first connect and verify the certificate and only then send the http data. See the implementation of for guidance on how to do this.

Using client certificates

Secure web communications are encrypted using symmetric crypto keys exchanged using encryption based on the certificate of the server. Therefore in all SSL connections the server must have a certificate. This serves both to authenticate the server to the clients and to perform the key exchange.

Sometimes it is necessary to authenticate the client as well. Two options are available: HTTP basic authentication and a client side certificate. The basic authentication over HTTPS is actually quite safe because HTTPS guarantees that the password will not travel in the clear. Never-the-less, problems like easily guessable passwords remain. The client certificate method involves authentication of the client at the SSL level using a certificate. For this to work, both the client and the server have certificates (which typically are different) and private keys.

The API functions outlined above accept additional arguments that allow one to supply the client side certificate and key files. The format of these files is the same as used for server certificates and the caveat about encrypting private keys applies.

($page, $result, %headers) = # 2c = get_https('www.bacus.pt', 443, '/protected.html', make_headers(Authorization => 'Basic ' . MIME::Base64::encode("$user:$pass",'')), '', $mime_type6, $path_to_crt7, $path_to_key8);

($page, $response, %reply_headers) = post_https('www.bacus.pt', 443, '/foo.cgi', # 3b make_headers('Authorization' => 'Basic ' . MIME::Base64::encode("$user:$pass",'')), make_form(OK => '1', name => 'Sampo'), $mime_type6, $path_to_crt7, $path_to_key8);

@]

Case 2c (in SYNOPSIS) demonstrates getting a password protected page that also requires a client certificate, i.e. it is possible to use both authentication methods simultaneously.

Case 3b (in SYNOPSIS) is a full blown POST to a secure server that requires both password authentication and a client certificate, just like in case 2c.

Note: The client will not send a certificate unless the server requests one. This is typically achieved by setting the verify mode to on the server:
See for a full description.

Working through a web proxy

set_proxy:
can use a web proxy to make its connections. You need to first set the proxy host and port using and then just use the normal API functions, e.g:

Net::SSLeay::set_proxy('gateway.myorg.com', 8080); ($page) = get_https('www.bacus.pt', 443, '/');

@]

If your proxy requires authentication, you can supply a username and password as well

Net::SSLeay::set_proxy('gateway.myorg.com', 8080, 'joe', 'salainen'); ($page, $result, %headers) = = get_https('www.bacus.pt', 443, '/protected.html', make_headers(Authorization => 'Basic ' . MIME::Base64::encode("susie:pass",'')) );

@]

This example demonstrates the case where we authenticate to the proxy as and to the final web server as . Proxy authentication requires the module to work.

HTTP (without S) API

get_http:
post_http:
tcpcat:
get_httpx:
post_httpx:
tcpxcat:
Over the years it has become clear that it would be convenient to use the light-weight flavour API of for normal HTTP as well (see for the heavy-weight object-oriented approach). In fact it would be nice to be able to flip https on and off on the fly. Thus regular HTTP support was evolved.

use Net::SSLeay qw(get_http post_http tcpcat get_httpx post_httpx tcpxcat make_headers make_form);

($page, $result, %headers) = get_http('www.bacus.pt', 443, '/protected.html', make_headers(Authorization => 'Basic ' . MIME::Base64::encode("$user:$pass",'')) );

($page, $response, %reply_headers) = post_http('www.bacus.pt', 443, '/foo.cgi', '', make_form(OK => '1', name => 'Sampo' ));

($reply, $err) = tcpcat($host, $port, $request);

($page, $result, %headers) = get_httpx($usessl, 'www.bacus.pt', 443, '/protected.html', make_headers(Authorization => 'Basic ' . MIME::Base64::encode("$user:$pass",'')) );

($page, $response, %reply_headers) = post_httpx($usessl, 'www.bacus.pt', 443, '/foo.cgi', '', make_form(OK => '1', name => 'Sampo' ));

($reply, $err, $server_cert) = tcpxcat($usessl, $host, $port, $request);

@]

As can be seen, the family of APIs takes as the first argument a flag which indicates whether SSL is used or not.

Certificate verification and Certificate Revocation Lists (CRLs)

OpenSSL supports the ability to verify peer certificates. It can also optionally check the peer certificate against a Certificate Revocation List (CRL) from the certificates issuer. A CRL is a file, created by the certificate issuer that lists all the certificates that it previously signed, but which it now revokes. CRLs are in PEM format.

You can enable checking like this:
After setting this flag, if OpenSSL checks a peer's certificate, then it will attempt to find a CRL for the issuer. It does this by looking for a specially named file in the search directory specified by CTX_load_verify_locations. CRL files are named with the hash of the issuer's subject name, followed by , etc. For example , . It will read all the .r files for the issuer, and then check for a revocation of the peer certificate in all of them. (You can also force it to look in a specific named CRL file., see below). You can find out the hash of the issuer subject name in a CRL with

If the peer certificate does not pass the revocation list, or if no CRL is found, then the handshaking fails with an error.

You can also force OpenSSL to look for CRLs in one or more arbitrarily named files.

Usually the URLs where you can download the CRLs is contained in the certificate itself and you can extract them with

But there is no automatic downloading of the CRLs and often these CRLs are too huge to just download them to verify a single certificate. Also, these CRLs are often in DER format which you need to convert to PEM before you can use it:

So as an alternative for faster and timely revocation checks you better use the Online Status Revocation Protocol (OCSP).

Certificate verification and Online Status Revocation Protocol (OCSP)

While checking for revoked certificates is possible and fast with Certificate Revocation Lists, you need to download the complete and often huge list before you can verify a single certificate.

A faster way is to ask the CA to check the revocation of just a single or a few certificates using OCSP. Basically you generate for each certificate an OCSP_CERTID based on the certificate itself and its issuer, put the ids togetether into an OCSP_REQUEST and send the request to the URL given in the certificate.

As a result you get back an OCSP_RESPONSE and need to check the status of the response, check that it is valid (e.g. signed by the CA) and finally extract the information about each OCSP_CERTID to find out if the certificate is still valid or got revoked.

With Net::SSLeay this can be done like this:

# get id(s) for given certs, like from get_peer_certificate # or get_peer_cert_chain. This will croak if # - one tries to make an OCSP_CERTID for a self-signed certificate # - the issuer of the certificate cannot be found in the SSL objects # store, nor in the current certificate chain my $cert = Net::SSLeay::get_peer_certificate($ssl); my $id = eval { Net::SSLeay::OCSP_cert2ids($ssl,$cert) }; die "failed to make OCSP_CERTID: $@" if $@;

# create OCSP_REQUEST from id(s) # Multiple can be put into the same request, if the same OCSP responder # is responsible for them. my $req = Net::SSLeay::OCSP_ids2req($id);

# determine URI of OCSP responder my $uri = Net::SSLeay::P_X509_get_ocsp_uri($cert);

# Send stringified OCSP_REQUEST with POST to $uri. # We can ignore certificate verification for https, because the OCSP # response itself is signed. my $ua = HTTP::Tiny->new(verify_SSL => 0); my $res = $ua->request( 'POST',$uri, { headers => { 'Content-type' => 'application/ocsp-request' }, content => Net::SSLeay::i2d_OCSP_REQUEST($req) }); my $content = $res && $res->{success} && $res->{content} or die "query failed";

# Extract OCSP_RESPONSE. # this will croak if the string is not an OCSP_RESPONSE my $resp = eval { Net::SSLeay::d2i_OCSP_RESPONSE($content) };

# Check status of response. my $status = Net::SSLeay::OCSP_response_status($resp); if ($status != Net::SSLeay::OCSP_RESPONSE_STATUS_SUCCESSFUL()) die "OCSP response failed: ". Net::SSLeay::OCSP_response_status_str($status); }

# Verify signature of response and if nonce matches request. # This will croak if there is a nonce in the response, but it does not match # the request. It will return false if the signature could not be verified, # in which case details can be retrieved with Net::SSLeay::ERR_get_error. # It will not complain if the response does not contain a nonce, which is # usually the case with pre-signed responses. if ( ! eval { Net::SSLeay::OCSP_response_verify($ssl,$resp,$req) }) { die "OCSP response verification failed"; }

# Extract information from OCSP_RESPONSE for each of the ids.

# If called in scalar context it will return the time (as time_t), when the # next update is due (minimum of all successful responses inside $resp). It # will croak on the following problems: # - response is expired or not yet valid # - no response for given OCSP_CERTID # - certificate status is not good (e.g. revoked or unknown) if ( my $nextupd = eval { Net::SSLeay::OCSP_response_results($resp,$id) }) { warn "certificate is valid, next update in ". ($nextupd-time())." seconds\n"; } else { die "certificate is not valid: $@"; }

# But in array context it will return detailled information about each given # OCSP_CERTID instead croaking on errors: # if no @ids are given it will return information about all single responses # in the OCSP_RESPONSE my @results = Net::SSLeay::OCSP_response_results($resp,@ids); for my $r (@results) { print Dumper($r); # @results are in the same order as the @ids and contain: # $r->[0] - OCSP_CERTID # $r->[1] - undef if no error (certificate good) OR error message as string # $r->[2] - hash with details: # thisUpdate - time_t of this single response # nextUpdate - time_t when update is expected # statusType - integer: # V_OCSP_CERTSTATUS_GOOD(0) # V_OCSP_CERTSTATUS_REVOKED?(1) # V_OCSP_CERTSTATUS_UNKNOWN?(2) # revocationTime - time_t (only if revoked) # revocationReason - integer (only if revoked) # revocationReason_str - reason as string (only if revoked) }

@]

To further speed up certificate revocation checking one can use a TLS extension to instruct the server to staple the OCSP response:

Using Net::SSLeay in multi-threaded applications

IMPORTANT: versions 1.42 or earlier are not thread-safe!

Net::SSLeay module implements all necessary stuff to be ready for multi-threaded environment - it requires openssl-0.9.7 or newer. The implementation fully follows thread safety related requirements of openssl library(see <http://www.openssl.org/docs/crypto/threads.html>).

If you are about to use Net::SSLeay (or any other module based on Net::SSLeay) in multi-threaded perl application it is recommended to follow this best-practice:

Initialization

Load and initialize Net::SSLeay module in the main thread:

NOTE: Openssl's function (which is also aliased as , and ) is not re-entrant and multiple calls can cause a crash in threaded application. Net::SSLeay implements flags preventing repeated calls to this function, therefore even multiple initialization via Net::SSLeay::SSLeay_add_ssl_algorithms() should work without trouble.

Using callbacks

Do not use callbacks across threads (the module blocks cross-thread callback operations and throws a warning). Allways do the callback setup, callback use and callback destruction within the same thread.

Using openssl elements

All openssl elements (X509, SSL_CTX, ...) can be directly passed between threads.

Or:

Using other perl modules based on Net::SSLeay

It should be fine to use any other module based on Net::SSLeay (like IO::Socket::SSL) in multi-threaded applications. It is generally recommended to do any global initialization of such a module in the main thread before calling or but it might differ module by module.

To be safe you can load and init Net::SSLeay explicitly in the main thread:

Or even safer:

Combining Net::SSLeay with other modules linked with openssl

BEWARE: This might be a big trouble! This is not guaranteed be thread-safe!

There are many other (XS) modules linked directly to openssl library (like Crypt::SSLeay).

As it is expected that also ``another module will call at some point we have again a trouble with multiple openssl initialization by Net::SSLeay and ``another module.

As you can expect Net::SSLeay is not able to avoid multiple initialization of openssl library called by ``another'' module, thus you have to handle this on your own (in some cases it might not be possible at all to avoid this).

Threading with get_https and friends

The convenience functions get_https, post_https etc all initialize the SSL library by calling Net::SSLeay::initialize which does the conventional library initialization:

Net::SSLeay::initialize initializes the SSL library at most once. You can override the Net::SSLeay::initialize function if you desire some other type of initialization behaviour by get_https and friends. You can call Net::SSLeay::initialize from your own code if you desire this conventional library initialization.

Convenience routines

To be used with Low level API

randomize
seeds the openssl PRNG with (see the top of for how to change or configure this) and optionally with user provided data. It is very important to properly seed your random numbers, so do not forget to call this. The high level API functions automatically call so it is not needed with them. See also caveats.

:

set_cert_and_key

takes two file names as arguments and sets the certificate and private key to those. This can be used to set either server certificates or client certificates.

:

dump_peer_certificate

allows you to get a plaintext description of the certificate the peer (usually the server) presented to us.

:

ssl_read_all

see ssl_write_all (below)

:

ssl_write_all
and provide true blocking semantics for these operations (see limitation, below, for explanation). These are much preferred to the low level API equivalents (which implement BSD blocking semantics). The message argument to can be a reference. This is helpful to avoid unnecessary copying when writing something big, e.g:
:
ssl_read_CRLF
uses to read in a line terminated with a carriage return followed by a linefeed (CRLF). The CRLF is included in the returned scalar.

:

ssl_read_until
uses to read from the SSL input stream until it encounters a programmer specified delimiter. If the delimiter is undefined, is used. If is undefined, is used. One can optionally set a maximum length of bytes to read from the SSL input stream.

:

ssl_write_CRLF
writes and appends CRLF to the SSL output stream.

:

Initialization

In order to use the low level API you should start your programs with the following incantation:

Error handling functions

I can not emphasize the need to check for error enough. Use these functions even in the most simple programs, they will reduce debugging time greatly. Do not ask questions on the mailing list without having first sprinkled these in your code.

die_now:
die_if_ssl_error
and are used to conveniently print the SSLeay error stack when something goes wrong:
:
print_errs
You can also use to dump the error stack without exiting the program. As can be seen, your code becomes much more readable if you import the error reporting functions into your main name space.

:

Sockets

Perl uses file handles for all I/O. While SSLeay has a quite flexible BIO mechanism and perl has an evolved PerlIO mechanism, this module still sticks to using file descriptors. Thus to attach SSLeay to a socket you should use to extract the underlying file descriptor:
You should also set to 1 to eliminate STDIO buffering so you do not get confused if you use perl I/O functions to manipulate your socket handle.
If you need to on the socket, go right ahead, but be warned that OpenSSL does some internal buffering so SSL_read does not always return data even if the socket selected for reading (just keep on selecting and trying to read). is no different from the C language OpenSSL in this respect.

Callbacks

You can establish a per-context verify callback function something like this:

It is used like this:

Per-context callbacks for decrypting private keys are implemented.

If Hello Extensions are supported by your OpenSSL, a session secret callback can be set up to be called when a session secret is set by openssl.

Establish it like this:

    Net::SSLeay::set_session_secret_cb($ssl, \&session_secret_cb,  );

It will be called like this:

No other callbacks are implemented. You do not need to use any callback for simple (i.e. normal) cases where the SSLeay built-in verify mechanism satisfies your needs.

It is required to reset these callbacks to undef immediately after use to prevent memory leaks, thread safety problems and crashes on exit that can occur if different threads set different callbacks.

If you want to use callback stuff, see examples/callback.pl! It's the only one I am able to make work reliably.

Low level API

In addition to the high level functions outlined above, this module contains straight-forward access to CRYPTO and SSL parts of OpenSSL C API.

See the headers from OpenSSL C distribution for a list of low level SSLeay functions to call (check SSLeay.xs to see if some function has been implemented). The module strips the initial off of the SSLeay names. Generally you should use in its place.
Note that some functions are prefixed with - these are very close to the original API however contain some kind of a wrapper making its interface more perl friendly.

For example:

In C:

#include <ssl.h>

err = SSL_set_verify (ssl, SSL_VERIFY_CLIENT_ONCE, &your_call_back_here);

@]

In Perl:

If the function does not start with you should use the full function name, e.g.:

The following new functions behave in perlish way:

Low level API: Version related functions

SSLeay

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

Gives version number (numeric) of underlaying openssl library.

You can use it like this:

:
SSLeay_version

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

Gives version number (string) of underlaying openssl library.

Check openssl doc <http://www.openssl.org/docs/crypto/SSLeay_version.html>

:

Low level API: Initialization related functions

library_init

Initialize SSL library by registering algorithms.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_library_init.html>

While the original function from OpenSSL always returns 1, Net::SSLeay adds a wrapper around it to make sure that the OpenSSL function is only called once. Thus the function will return 1 if initialization was done and 0 if not, i.e. if initialization was done already before.

:

add_ssl_algorithms

The alias for ``library_init''

:
OpenSSL_add_ssl_algorithms

The alias for ``library_init''

:
SSLeay_add_ssl_algorithms

The alias for ``library_init''

:
load_error_strings

Registers the error strings for all libcrypto + libssl related functions.

Check openssl doc <http://www.openssl.org/docs/crypto/ERR_load_crypto_strings.html>

:

ERR_load_crypto_strings

Registers the error strings for all libcrypto functions. No need to call this function if you have already called ``load_error_strings''.

Check openssl doc <http://www.openssl.org/docs/crypto/ERR_load_crypto_strings.html>

:

ERR_load_RAND_strings

Registers the error strings for RAND related functions. No need to call this function if you have already called ``load_error_strings''.

:
ERR_load_SSL_strings

Registers the error strings for SSL related functions. No need to call this function if you have already called ``load_error_strings''.

:
OpenSSL_add_all_algorithms

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Add algorithms to internal table.

Check openssl doc <http://www.openssl.org/docs/crypto/OpenSSL_add_all_algorithms.html>

:

OPENSSL_add_all_algorithms_conf

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Similar to `OpenSSL_add_all_algorithms'' - will ALWAYS load the config file

:
OPENSSL_add_all_algorithms_noconf

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Similar to `OpenSSL_add_all_algorithms'' - will NEVER load the config file

:

Low level API: ERR_* and SSL_alert_* related functions

NOTE: Please note that SSL_alert_* function have ``SSL_'' part stripped from their names.

ERR_clear_error

Clear the error queue.

Check openssl doc <http://www.openssl.org/docs/crypto/ERR_clear_error.html>

:

ERR_error_string
Generates a human-readable string representing the error code .

Check openssl doc <http://www.openssl.org/docs/crypto/ERR_error_string.html>

:

ERR_get_error

Returns the earliest error code from the thread's error queue and removes the entry. This function can be called repeatedly until there are no more error codes to return.

Check openssl doc <http://www.openssl.org/docs/crypto/ERR_get_error.html>

:

ERR_peek_error

Returns the earliest error code from the thread's error queue without modifying it.

Check openssl doc <http://www.openssl.org/docs/crypto/ERR_get_error.html>

:

ERR_put_error
Adds an error code to the thread's error queue. It signals that the error of code reason occurred in function of library , in line number of .

Check openssl doc <http://www.openssl.org/docs/crypto/ERR_put_error.html> and <http://www.openssl.org/docs/crypto/err.html>

:

alert_desc_string

Returns a two letter string as a short form describing the reason of the alert specified by value.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_alert_type_string.html>

:

alert_desc_string_long

Returns a string describing the reason of the alert specified by value.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_alert_type_string.html>

:

alert_type_string

Returns a one letter string indicating the type of the alert specified by value.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_alert_type_string.html>

:

alert_type_string_long

Returns a string indicating the type of the alert specified by value.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_alert_type_string.html>

:

Low level API: SSL_METHOD_* related functions

SSLv2_method

Returns SSL_METHOD structure corresponding to SSLv2 method, the return value can be later used as a param of ``CTX_new_with_method''. Only available where supported by the underlying openssl.

:
SSLv3_method

Returns SSL_METHOD structure corresponding to SSLv3 method, the return value can be later used as a param of ``CTX_new_with_method''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_new.html>

:

TLSv1_method

Returns SSL_METHOD structure corresponding to TLSv1 method, the return value can be later used as a param of ``CTX_new_with_method''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_new.html>

:

TLSv1_1_method

Returns SSL_METHOD structure corresponding to TLSv1_1 method, the return value can be later used as a param of ``CTX_new_with_method''. Only available where supported by the underlying openssl.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_new.html>

:

TLSv1_2_method

Returns SSL_METHOD structure corresponding to TLSv1_2 method, the return value can be later used as a param of ``CTX_new_with_method''. Only available where supported by the underlying openssl.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_new.html>

:

Low level API: ENGINE_* related functions

ENGINE_load_builtin_engines

Load all bundled ENGINEs into memory and make them visible.

Check openssl doc <http://www.openssl.org/docs/crypto/engine.html>

:

ENGINE_register_all_complete

Register all loaded ENGINEs for every algorithm they collectively implement.

Check openssl doc <http://www.openssl.org/docs/crypto/engine.html>

:

ENGINE_set_default
Set default engine to + set its flags to .

Check openssl doc <http://www.openssl.org/docs/crypto/engine.html>

:

ENGINE_by_id
Get ENGINE by its identification .

Check openssl doc <http://www.openssl.org/docs/crypto/engine.html>

:

Low level API: EVP_PKEY_* related functions

EVP_PKEY_copy_parameters
Copies the parameters from key to key .

Check openssl doc <http://www.openssl.org/docs/crypto/EVP_PKEY_cmp.html>

:

EVP_PKEY_new

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Creates a new EVP_PKEY structure.

Check openssl doc <http://www.openssl.org/docs/crypto/EVP_PKEY_new.html>

:

EVP_PKEY_free

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Free an allocated EVP_PKEY structure.

Check openssl doc <http://www.openssl.org/docs/crypto/EVP_PKEY_new.html>

:

EVP_PKEY_assign_RSA

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Set the key referenced by to
NOTE: In accordance with the OpenSSL naming convention the assigned to the using the ``1'' functions must be freed as well as .

Check openssl doc <http://www.openssl.org/docs/crypto/EVP_PKEY_set1_RSA.html>

:

EVP_PKEY_bits

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns the size of the key in bits.
:
EVP_PKEY_size

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns the maximum size of a signature in bytes. The actual signature may be smaller.

Check openssl doc <http://www.openssl.org/docs/crypto/EVP_SignInit.html>

:

EVP_PKEY_id

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-1.0.0

Returns type (integer value of corresponding NID).

Example:

:

Low level API: PEM_* related functions

Check openssl doc <http://www.openssl.org/docs/crypto/pem.html>

PEM_read_bio_X509

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Loads PEM formatted X509 certificate via given BIO structure.

Example:

:
PEM_read_bio_X509_REQ

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Loads PEM formatted X509_REQ object via given BIO structure.

Example:

:
PEM_read_bio_DHparams

Reads DH structure from BIO.

:
PEM_read_bio_X509_CRL

Reads X509_CRL structure from BIO.

:
PEM_read_bio_PrivateKey

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Loads PEM formatted private key via given BIO structure.

Example:

To use password you have the following options:

Callback function signature:

:
PEM_get_string_X509

NOTE: Does not exactly correspond to any low level API function

Converts/exports X509 certificate to string (PEM format).

:
PEM_get_string_PrivateKey

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Converts public key into PEM formatted string (optionally protected with password).

Examples:

:
PEM_get_string_X509_CRL

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Converts X509_CRL object into PEM formatted string.
:
PEM_get_string_X509_REQ

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Converts X509_REQ object into PEM formatted string.
:

Low level API: d2i_* (DER format) related functions

d2i_X509_bio

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Loads DER formatted X509 certificate via given BIO structure.

Example:

Check openssl doc <http://www.openssl.org/docs/crypto/d2i_X509.html>

:

d2i_X509_CRL_bio

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Loads DER formatted X509_CRL object via given BIO structure.

Example:

:
d2i_X509_REQ_bio

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Loads DER formatted X509_REQ object via given BIO structure.

Example:

:

Low level API: PKCS12 related functions

P_PKCS12_load_file

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Loads X509 certificate + private key + certificates of CA chain (if present in PKCS12 file).

IMPORTANT NOTE: after you do the job you need to call X509_free() on + all members of and EVP_PKEY_free() on .

Examples:

:

Low level API: SESSION_* related functions

d2i_SSL_SESSION
Transforms the external ASN1 representation of an SSL/TLS session, stored as binary data at location pp with length of , into an SSL_SESSION object.

??? (does this function really work?)

Check openssl doc <http://www.openssl.org/docs/ssl/d2i_SSL_SESSION.html>

:

i2d_SSL_SESSION

Transforms the SSL_SESSION object in into the ASN1 representation and stores it into the memory location pointed to by pp. The length of the resulting ASN1 representation is returned.

??? (does this function really work?)

Check openssl doc <http://www.openssl.org/docs/ssl/d2i_SSL_SESSION.html>

:

SESSION_new

Creates a new SSL_SESSION structure.

:
SESSION_free

Free an allocated SSL_SESSION structure.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_free.html>

:

SESSION_cmp

Compare two SSL_SESSION structures.

NOTE: Not available in openssl 1.0 or later

:

SESSION_get_app_data

Can be used to get application defined value/data.

:
SESSION_set_app_data

Can be used to set some application defined value/data.

:
SESSION_get_ex_data
Is used to retrieve the information for from session .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_get_ex_new_index.html>

:

SESSION_set_ex_data

Is used to store application data at arg for idx into the session object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_get_ex_new_index.html>

:

SESSION_get_ex_new_index

Is used to register a new index for application specific data.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_get_ex_new_index.html>

:

SESSION_get_master_key

NOTE: Does not exactly correspond to any low level API function

Returns 'master_key' value from SSL_SESSION structure
:
SESSION_set_master_key
Sets 'master_key' value for SSL_SESSION structure
:
SESSION_get_time

Returns the time at which the session s was established. The time is given in seconds since 1.1.1970.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_get_time.html>

:

get_time

Technically the same functionality as ``SESSION_get_time''.

:
SESSION_get_timeout
Returns the timeout value set for session in seconds.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_get_time.html>

:

get_timeout

Technically the same functionality as ``SESSION_get_timeout''.

:
SESSION_print

NOTE: Does not exactly correspond to any low level API function

Prints session details (e.g. protocol version, cipher, session-id ...) to BIO.

You have to use necessary BIO functions like this:

:
SESSION_print_fp

Prints session details (e.g. protocol version, cipher, session-id ...) to file handle.

Example:

:
SESSION_set_time
Replaces the creation time of the session s with the chosen value (seconds since 1.1.1970).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_get_time.html>

:

set_time

Technically the same functionality as ``SESSION_set_time''.

:
SESSION_set_timeout
Sets the timeout value for session s in seconds to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_SESSION_get_time.html>

:

set_timeout

Technically the same functionality as ``SESSION_set_timeout''.

:

Low level API: SSL_CTX_* related functions

NOTE: Please note that the function described in this chapter have ``SSL_'' part stripped from their original openssl names.

CTX_add_client_CA
Adds the CA name extracted from to the list of CAs sent to the client when requesting a client certificate for .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_client_CA_list.html>

:

CTX_add_extra_chain_cert
Adds the certificate to the certificate chain presented together with the certificate. Several certificates can be added one after the other.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_add_extra_chain_cert.html>

:

CTX_add_session
Adds the session to the context .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_add_session.html>

:

CTX_callback_ctrl

??? (more info needed)

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_ctrl.html>

:

CTX_check_private_key
Checks the consistency of a private key with the corresponding certificate loaded into .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

CTX_ctrl

Internal handling function for SSL_CTX objects.

BEWARE: openssl doc says: This function should never be called directly!

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_ctrl.html>

:

CTX_flush_sessions
Causes a run through the session cache of to remove sessions expired at time .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_flush_sessions.html>

:

CTX_free

Free an allocated SSL_CTX object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_free.html>

:

CTX_get_app_data

Can be used to get application defined value/data.

:
CTX_set_app_data

Can be used to set some application defined value/data.

:
CTX_get_cert_store

Returns the current certificate verification storage.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_cert_store.html>

:

CTX_get_client_CA_list
Returns the list of client CAs explicitly set for using ``CTX_set_client_CA_list''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_client_CA_list.html>

:

CTX_get_ex_data
Is used to retrieve the information for index from .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_get_ex_new_index.html>

:

CTX_get_ex_new_index

Is used to register a new index for application specific data.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_get_ex_new_index.html>

:

CTX_get_mode

Returns the mode set for ctx.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html>

:

CTX_set_mode
Adds the mode set via bitmask in to . Options already set before are not cleared.

For bitmask details see ``CTX_get_mode'' (above).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html>

:

CTX_get_options
Returns the options (bitmask) set for .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html>

:

CTX_set_options
Adds the options set via bitmask in to ctx. Options already set before are not cleared.

For bitmask details see ``CTX_get_options'' (above).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html>

:

CTX_get_quiet_shutdown
Returns the 'quiet shutdown' setting of .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_quiet_shutdown.html>

:

CTX_get_read_ahead
:
CTX_get_session_cache_mode

Returns the currently used cache mode (bitmask).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_session_cache_mode.html>

:

CTX_set_session_cache_mode
Enables/disables session caching by setting the operational mode for to .

For bitmask details see ``CTX_get_session_cache_mode'' (above).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_session_cache_mode.html>

:

CTX_get_timeout
Returns the currently set timeout value for .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_timeout.html>

:

CTX_get_verify_depth
Returns the verification depth limit currently set in . If no limit has been explicitly set, -1 is returned and the default value will be used.",

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_get_verify_mode.html>

:

CTX_get_verify_mode
Returns the verification mode (bitmask) currently set in .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_get_verify_mode.html>

:

CTX_set_verify
Sets the verification flags for to be and specifies the verify_callback function to be used.

For bitmask details see ``CTX_get_verify_mode'' (above).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html>

:

CTX_load_verify_locations
Specifies the locations for , at which CA certificates for verification purposes are located. The certificates available via and are trusted.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html>

:

CTX_need_tmp_RSA
Return the result of
:
CTX_new

The same as ``CTX_v23_new''

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_new.html>

:

CTX_v2_new

Creates a new SSL_CTX object - based on SSLv2_method() - as framework to establish TLS/SSL enabled connections.

:
CTX_v23_new

Creates a new SSL_CTX object - based on SSLv23_method() - as framework to establish TLS/SSL enabled connections.

:
CTX_v3_new

Creates a new SSL_CTX object - based on SSLv3_method() - as framework to establish TLS/SSL enabled connections.

:
CTX_tlsv1_new

Creates a new SSL_CTX object - based on TLSv1_method() - as framework to establish TLS/SSL enabled connections.

:
CTX_tlsv1_1_new

Creates a new SSL_CTX object - based on TLSv1_1_method() - as framework to establish TLS/SSL enabled connections. Only available where supported by the underlying openssl.

:
CTX_tlsv1_2_new

Creates a new SSL_CTX object - based on TLSv1_2_method() - as framework to establish TLS/SSL enabled connections. Only available where supported by the underlying openssl.

:
CTX_new_with_method
Creates a new SSL_CTX object based on method

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_new.html>

:

CTX_remove_session
Removes the session from the context .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_add_session.html>

:

CTX_sess_accept

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_accept_good

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_accept_renegotiate

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_cache_full

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_cb_hits

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_connect

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_connect_good

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_connect_renegotiate

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_get_cache_size

Returns the currently valid session cache size.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_set_cache_size.html>

:

CTX_sess_hits

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_misses

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_number

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sess_set_cache_size
Sets the size of the internal session cache of context to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_set_cache_size.html>

:

CTX_sess_timeouts

Returns the number of sessions proposed by clients and either found in the internal or external session cache in server mode, but that were invalid due to timeout. These sessions are not included in the SSL_CTX_sess_hits count.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>

:

CTX_sessions

Returns a pointer to the lhash databases containing the internal session cache for ctx.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_sessions.html>

:

CTX_set1_param
Applies X509 verification parameters on
:
CTX_set_cert_store
Sets/replaces the certificate verification storage of to/with .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_cert_store.html>

:

CTX_set_cert_verify_callback
Sets the verification callback function for . SSL objects that are created from inherit the setting valid at the time when is called.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_cert_verify_callback.html>

:

CTX_set_cipher_list
Sets the list of available ciphers for using the control string . The list of ciphers is inherited by all ssl objects created from .
The format of is described in <http://www.openssl.org/docs/apps/ciphers.html>

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_cipher_list.html>

:

CTX_set_client_CA_list
Sets the list of CAs sent to the client when requesting a client certificate for .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_client_CA_list.html>

:

CTX_set_default_passwd_cb

Sets the default password callback called when loading/storing a PEM certificate with encryption.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_default_passwd_cb.html>

:

CTX_set_default_passwd_cb_userdata

Sets a pointer to userdata which will be provided to the password callback on invocation.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_default_passwd_cb.html>

:

CTX_set_default_verify_paths

??? (more info needed)

:
CTX_set_ex_data
Is used to store application data at for into the object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_get_ex_new_index.html>

:

CTX_set_purpose
:
CTX_set_quiet_shutdown
Sets the 'quiet shutdown' flag for to be mode. SSL objects created from inherit the mode valid at the time is called.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_quiet_shutdown.html>

:

CTX_set_read_ahead
:
CTX_set_session_id_context
Sets the context of length within which a session can be reused for the object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_session_id_context.html>

:

CTX_set_ssl_version
Sets a new default TLS/SSL method for SSL objects newly created from this . SSL objects already created with are not affected, except when is being called.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_ssl_version.html>

:

CTX_set_timeout
Sets the timeout for newly created sessions for to . The timeout value must be given in seconds.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_timeout.html>

:

CTX_set_tmp_dh
Sets DH parameters to be used to be . The key is inherited by all ssl objects created from .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_dh_callback.html>

:

CTX_set_tmp_dh_callback
Sets the callback function for to be used when a DH parameters are required to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_dh_callback.html>

:

CTX_set_tmp_rsa
Sets the temporary/ephemeral RSA key to be used to be .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_rsa_callback.html>

:

CTX_set_tmp_rsa_callback
Sets the callback function for ctx to be used when a temporary/ephemeral RSA key is required to .

??? (does this function really work?)

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_rsa_callback.html>

:

CTX_set_trust
:
CTX_set_verify_depth

Sets the maximum depth for the certificate chain verification that shall be allowed for ctx.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html>

:

CTX_use_PKCS12_file
Adds the certificate and private key from PKCS12 file to .
:
CTX_use_PrivateKey
Adds the private key to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

CTX_use_PrivateKey_file
Adds the first private key found in to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

CTX_use_RSAPrivateKey
Adds the RSA private key to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

CTX_use_RSAPrivateKey_file
Adds the first RSA private key found in to .
:
CTX_use_certificate
Loads the certificate into

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

CTX_use_certificate_chain_file
Loads a certificate chain from into . The certificates must be in PEM format and must be sorted starting with the subject's certificate (actual client or server certificate), followed by intermediate CA certificates if applicable, and ending at the highest level (root) CA.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

CTX_use_certificate_file
Loads the first certificate stored in into .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

Low level API: SSL_* related functions

NOTE: Please note that the function described in this chapter have ``SSL_'' part stripped from their original openssl names.

new
Creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context connection method (SSLv2/v3/TLSv1), options, verification settings, timeout settings.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_new.html>

:

accept

Waits for a TLS/SSL client to initiate the TLS/SSL handshake. The communication channel must already have been set and assigned to the ssl by setting an underlying BIO.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_accept.html>

:

add_client_CA

Adds the CA name extracted from cacert to the list of CAs sent to the client when requesting a client certificate for the chosen ssl, overriding the setting valid for ssl's SSL_CTX object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_client_CA_list.html>

:

callback_ctrl

??? (more info needed)

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_ctrl.html>

:

check_private_key
Checks the consistency of a private key with the corresponding certificate loaded into

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

clear

Reset SSL object to allow another connection.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_clear.html>

:

connect

Initiate the TLS/SSL handshake with an TLS/SSL server.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_connect.html>

:

copy_session_id
Copies the session structure fro to (+ also the private key and certificate associated with ).
:
ctrl

Internal handling function for SSL objects.

BEWARE: openssl doc says: This function should never be called directly!

For more details about valid values check ``CTX_ctrl''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_ctrl.html>

:

do_handshake

Will wait for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started. The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state?(3).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_do_handshake.html>

:

dup
Returns a duplicate of .
:
free

Free an allocated SSL structure.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_free.html>

:

get_SSL_CTX
Returns a pointer to the SSL_CTX object, from which was created with Net::SSLeay::new.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_SSL_CTX.html>

:

set_SSL_CTX

Sets the SSL_CTX the corresponds to an SSL session.

:
get_app_data

Can be used to get application defined value/data.

:
set_app_data

Can be used to set some application defined value/data.

:
get_certificate

Gets X509 certificate from an established SSL connection.

:
get_cipher

Obtains the name of the currently used cipher.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_current_cipher.html>

:

get_cipher_bits

Obtain the number of secret/algorithm bits used.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_current_cipher.html> and <http://www.openssl.org/docs/ssl/SSL_CIPHER_get_name.html>

:

get_cipher_list
Returns the name (string) of the SSL_CIPHER listed for with priority .

Call Net::SSLeay::get_cipher_list with priority starting from 0 to obtain the sorted list of available ciphers, until '' is returned:

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_ciphers.html>

:

get_client_CA_list
Returns the list of client CAs explicitly set for using or 's SSL_CTX object with , when in server mode.

In client mode, returns the list of client CAs sent from the server, if any.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_client_CA_list.html>

:

get_current_cipher

Returns the cipher actually used.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_current_cipher.html>

:

get_default_timeout
Returns the default timeout value assigned to SSL_SESSION objects negotiated for the protocol valid for .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_default_timeout.html>

:

get_error
Returns a result code for a preceding call to , , , , or on .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_error.html>

:

get_ex_data
Is used to retrieve the information for from .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_ex_new_index.html>

:

set_ex_data
Is used to store application data at for into the object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_ex_new_index.html>

:

get_ex_new_index

Is used to register a new index for application specific data.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_ex_new_index.html>

:

get_fd
Returns the file descriptor which is linked to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_fd.html>

:

get_finished

Obtains the latest 'Finished' message sent to the peer.

??? (does this function really work?)

:
get_peer_finished

Obtains the latest 'Finished' message expected from the peer.

??? (does this function really work?)

:
get_keyblock_size

NOTE: Does not exactly correspond to any low level API function.

??? (more info needed)

:
get_mode
Returns the mode (bitmask) set for .

To decode the return value (bitmask) see documentation for ``CTX_get_mode''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html>

:

set_mode
Adds the mode set via bitmask in to . Options already set before are not cleared.
For bitmask details see ``CTX_get_mode''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html>

:

get_options
Returns the options (bitmask) set for .

To decode the return value (bitmask) see documentation for ``CTX_get_options''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html>

:

set_options
Adds the options set via bitmask in to . Options already set before are not cleared!
For bitmask details see ``CTX_get_options''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html>

:

get_peer_certificate

Get the X509 certificate of the peer.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_peer_certificate.html>

:

get_peer_cert_chain

Get the certificate chain of the peer as an array of X509 structures.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_peer_certificate.html>

:

get_quiet_shutdown

Returns the 'quiet shutdown' setting of ssl.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_quiet_shutdown.html>

:

get_rbio
Get 'read' BIO linked to an SSL object .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_rbio.html>

:

get_read_ahead
:
set_read_ahead
:
get_server_random

Returns internal SSLv3 server_random value.

:
get_client_random

NOTE: Does not exactly correspond to any low level API function

Returns internal SSLv3 client_random value.

:
export_keying_material
Returns a buffer of bytes of keying material based on the constant string using the masterkey and client and server random strings as described in draft-ietf-pppext-eap-ttls-01.txt and See rfc2716 If p is present, it will be concatenated before generating the keying material Returns undef on error
:
get_session
Retrieve TLS/SSL session data used in . The reference count of the SSL_SESSION is NOT incremented.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_session.html>

:

SSL_get0_session
The alias for ``get_session'' (note that the name is NOT ).
:
get1_session
Returns a pointer to the SSL_SESSION actually used in . The reference count of the SSL_SESSION is incremented by 1.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_session.html>

:

get_shared_ciphers
Returns string with a list (colon ':' separated) of ciphers shared between client and server within SSL session .
:
get_shutdown
Returns the shutdown mode of .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_shutdown.html>

:

get_ssl_method
Returns a function pointer to the TLS/SSL method set in .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_ssl_version.html>

:

get_state

Returns the SSL connection state.

:
state

Exactly the same as ``get_state''.

:
set_state

Sets the SSL connection state.

:
get_verify_depth
Returns the verification depth limit currently set in .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_get_verify_mode.html>

:

set_verify_depth
Sets the maximum depth for the certificate chain verification that shall be allowed for .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html>

:

get_verify_mode
Returns the verification mode (bitmask) currently set in .

To decode the return value (bitmask) see documentation for ``CTX_get_verify_mode''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_get_verify_mode.html>

:

set_verify
Sets the verification flags for to be and specifies the function to be used.
For bitmask details see ``CTX_get_verify_mode''.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html>

:

get_verify_result

Returns the result of the verification of the X509 certificate presented by the peer, if any.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_verify_result.html>

:

set_verify_result

Override result of peer certificate verification.

For more info about valid return values see ``get_verify_result''

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_verify_result.html>

:

get_wbio
Get 'write' BIO linked to an SSL object .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_get_rbio.html>

:

load_client_CA_file

Load X509 certificates from file (PEM formatted).

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_load_client_CA_file.html>

:

clear_num_renegotiations
Executes SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS command on .
:
need_tmp_RSA
Executes SSL_CTRL_NEED_TMP_RSA command on .
:
num_renegotiations
Executes SSL_CTRL_GET_NUM_RENEGOTIATIONS command on .
:
total_renegotiations
Executes SSL_CTRL_GET_TOTAL_RENEGOTIATIONS command on .
:
peek
Copies bytes from the specified into the returned value. In contrast to the function, the data in the SSL buffer is unmodified after the SSL_peek() operation.
:
pending
Obtain number of readable bytes buffered in object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_pending.html>

:

read
Tries to read bytes from the specified .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_read.html>

:

renegotiate

Turn on flags for renegotiation so that renegotiation will happen

:
rstate_string
Returns a 2 letter string indicating the current read state of the SSL object .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_rstate_string.html>

:

rstate_string_long

Returns a string indicating the current read state of the SSL object ssl.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_rstate_string.html>

:

session_reused

Query whether a reused session was negotiated during handshake.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_session_reused.html>

:

set1_param
Applies X509 verification parameters on
:
set_accept_state
Sets to work in server mode.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_connect_state.html>

:

set_bio
Connects the BIOs and for the read and write operations of the TLS/SSL (encrypted) side of .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_bio.html>

:

set_cipher_list

Sets the list of ciphers only for ssl.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_cipher_list.html>

:

set_client_CA_list
Sets the list of CAs sent to the client when requesting a client certificate for the chosen , overriding the setting valid for 's SSL_CTX object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_client_CA_list.html>

:

set_connect_state
Sets to work in client mode.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_connect_state.html>

:

set_fd
Sets the file descriptor as the input/output facility for the TLS/SSL (encrypted) side of , will typically be the socket file descriptor of a network connection.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_fd.html>

:

set_rfd
Sets the file descriptor as the input (read) facility for the TLS/SSL (encrypted) side of .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_fd.html>

:

set_wfd

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_fd.html>

:

set_info_callback
Sets the callback function, that can be used to obtain state information for during connection setup and use. When callback is undef, the callback setting currently valid for ctx is used.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_info_callback.html>

:

CTX_set_info_callback

Sets the callback function on ctx, that can be used to obtain state information during ssl connection setup and use. When callback is undef, an existing callback will be disabled.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_info_callback.html>

:

set_pref_cipher
Sets the list of available ciphers for using the control string .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_cipher_list.html>

:

set_purpose
For more info about available identifiers see ``CTX_set_purpose''.

:

set_quiet_shutdown
Sets the 'quiet shutdown' flag for to be .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_quiet_shutdown.html>

:

set_session

Set a TLS/SSL session to be used during TLS/SSL connect.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_session.html>

:

set_session_id_context
Sets the context of length within which a session can be reused for the object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_session_id_context.html>

:

set_session_secret_cb

Setup pre-shared secret session resumption function.

:
set_shutdown
Sets the shutdown state of to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_set_shutdown.html>

:

set_ssl_method
Sets a new TLS/SSL method for a particular object.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_ssl_version.html>

:

set_tmp_dh
Sets DH parameters to be used to be .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_dh_callback.html>

:

set_tmp_dh_callback
Sets the callback function for to be used when a DH parameters are required to .

??? (does this function really work?)

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_dh_callback.html>

:

set_tmp_rsa
Sets the temporary/ephemeral RSA key to be used in to be .

Example:

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_rsa_callback.html>

:

set_tmp_rsa_callback
Sets the callback function for to be used when a temporary/ephemeral RSA key is required to .

??? (does this function really work?)

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_set_tmp_rsa_callback.html>

:

set_trust
For more details about values see ``CTX_set_trust''.

:

shutdown

Shuts down an active TLS/SSL connection. It sends the 'close notify' shutdown alert to the peer.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_shutdown.html>

:

state_string
Returns a 6 letter string indicating the current state of the SSL object .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_state_string.html>

:

state_string_long
Returns a string indicating the current state of the SSL object .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_state_string.html>

:

use_PrivateKey
Adds as private key to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_PrivateKey_ASN1
Adds the private key of type stored in to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_PrivateKey_file
Adds the first private key found in to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_RSAPrivateKey
Adds as RSA private key to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_RSAPrivateKey_ASN1
Adds RSA private key stored in to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_RSAPrivateKey_file
Adds the first RSA private key found in to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_certificate
Loads the certificate into .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_certificate_ASN1
Loads the ASN1 encoded certificate from to .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

use_certificate_file
Loads the first certificate stored in into .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html>

:

version

Returns SSL/TLS protocol version

:
want
Returns state information for the SSL object .

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_want.html>

:

write
Writes data from the buffer into the specified connection.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_write.html>

:

write_partial

NOTE: Does not exactly correspond to any low level API function

Writes a fragment of data in from the buffer into the specified connection.
:
set_tlsext_host_name

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.8f

Sets TLS servername extension on SLL object to value .
:

Low level API: RAND_* related functions

Check openssl doc related to RAND stuff <http://www.openssl.org/docs/crypto/rand.html>

RAND_add
Mixes the bytes at into the PRNG state.

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_add.html>

:

RAND_seed
Equivalent to ``RAND_add'' when == .

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_add.html>

:

RAND_status

Gives PRNG status (seeded enough or not).

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_add.html>

:

RAND_bytes
Puts cryptographically strong pseudo-random bytes into .

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_bytes.html>

:

RAND_pseudo_bytes
Puts pseudo-random (not necessarily unpredictable) bytes into .

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_bytes.html>

:

RAND_cleanup

Erase the PRNG state.

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_cleanup.html>

:

RAND_egd_bytes
Queries the entropy gathering daemon EGD on socket for bytes.

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_egd.html>

:

RAND_file_name

Generates a default path for the random seed file.

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_load_file.html>

:

RAND_load_file
Reads of bytes from and adds them to the PRNG.

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_load_file.html>

:

RAND_write_file
Writes 1024 random bytes to which can be used to initialize the PRNG by calling ``RAND_load_file'' in a later session.

Check openssl doc <http://www.openssl.org/docs/crypto/RAND_load_file.html>

:

RAND_poll

Collects some entropy from operating system and adds it to the PRNG.

:

Low level API: OBJ_* related functions

OBJ_cmp
Compares ASN1_OBJECT to ASN1_OBJECT .

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

OBJ_dup
Returns a copy/duplicate of .

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

OBJ_nid2ln
Returns long name for given NID .

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

OBJ_ln2nid
Returns NID corresponding to given long name .
:
OBJ_nid2sn
Returns short name for given NID .

Example:

:
OBJ_sn2nid
Returns NID corresponding to given short name .

Example:

:
OBJ_nid2obj
Returns ASN1_OBJECT for given NID .

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

OBJ_obj2nid
Returns NID corresponding to given ASN1_OBJECT .

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

OBJ_txt2obj
Converts the text string s into an ASN1_OBJECT structure. If is 0 then long names (e.g. 'commonName') and short names (e.g. 'CN') will be interpreted as well as numerical forms (e.g. '2.5.4.3'). If is 1 only the numerical form is acceptable.

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

OBJ_obj2txt

Converts the ASN1_OBJECT a into a textual representation.

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

OBJ_txt2nid
Returns NID corresponding to text string which can be a long name, a short name or the numerical representation of an object.

Example:

Check openssl doc <http://www.openssl.org/docs/crypto/OBJ_nid2obj.html>

:

Low level API: ASN1_INTEGER_* related functions

ASN1_INTEGER_new

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Creates a new ASN1_INTEGER structure.

:
ASN1_INTEGER_free

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Free an allocated ASN1_INTEGER structure.

:
ASN1_INTEGER_get

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns integer value of given ASN1_INTEGER object.

BEWARE: If the value stored in ASN1_INTEGER is greater than max. integer that can be stored in 'long' type (usually 32bit but may vary according to platform) then this function will return -1. For getting large ASN1_INTEGER values consider using ``P_ASN1_INTEGER_get_dec or ``P_ASN1_INTEGER_get_hex.

:
ASN1_INTEGER_set

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets value of given ASN1_INTEGER object to value
BEWARE: has max. limit (= max. integer that can be stored in 'long' type). For setting large ASN1_INTEGER values consider using ``P_ASN1_INTEGER_set_dec or ``P_ASN1_INTEGER_set_hex.
:
P_ASN1_INTEGER_get_dec

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns string with decimal representation of integer value of given ASN1_INTEGER object.

:
P_ASN1_INTEGER_get_hex

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns string with hexadecimal representation of integer value of given ASN1_INTEGER object.

:
P_ASN1_INTEGER_set_dec

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets value of given ASN1_INTEGER object to value (decimal string, suitable for large integers)
:
P_ASN1_INTEGER_set_hex

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets value of given ASN1_INTEGER object to value (hexadecimal string, suitable for large integers)
:

Low level API: ASN1_STRING_* related functions

P_ASN1_STRING_get

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns string value of given ASN1_STRING object.

:

Low level API: ASN1_TIME_* related functions

ASN1_TIME_new

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

:
ASN1_TIME_free

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

:
ASN1_TIME_set

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

BEWARE: It is platform dependent how this function will handle dates after 2038. Although perl's integer is large enough the internal implementation of this function is dependent on the size of time_t structure (32bit time_t has problem with 2038).

If you want to safely set date and time after 2038 use function ``P_ASN1_TIME_set_isotime''.

:

P_ASN1_TIME_get_isotime

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7e

NOTE: Does not exactly correspond to any low level API function

Gives ISO-8601 string representation of ASN1_TIME structure.

The output format is compatible with module DateTime::Format::RFC3339

:

P_ASN1_TIME_set_isotime

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7e

NOTE: Does not exactly correspond to any low level API function

Sets time and date value of ANS1_time structure.

The parameter has to be in full form like or or . Short forms like or are not supported.

:

P_ASN1_TIME_put2string

COMPATIBILITY: not available in Net-SSLeay-1.42 and before, has bugs with openssl-0.9.8i

NOTE: Does not exactly correspond to any low level API function

Gives string representation of ASN1_TIME structure.

:
P_ASN1_UTCTIME_put2string

NOTE: deprecated function, only for backward compatibility, just an alias for ``P_ASN1_TIME_put2string''

:

Low level API: X509_* related functions

X509_new

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Allocates and initializes a X509 structure.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_new.html>

:

X509_free

Frees up the X509 structure.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_new.html>

:

X509_certificate_type

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns bitmask with type of certificate .
:
X509_digest

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Computes digest/fingerprint of X509 using hash function.
:
X509_issuer_and_serial_hash

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sort of a checksum of issuer name and serial number of X509 certificate . The result is not a full hash (e.g. sha-1), it is kind-of-a-hash truncated to the size of 'unsigned long' (32 bits). The resulting value might differ across different openssl versions for the same X509 certificate.
:
X509_issuer_name_hash

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sort of a checksum of issuer name of X509 certificate . The result is not a full hash (e.g. sha-1), it is kind-of-a-hash truncated to the size of 'unsigned long' (32 bits). The resulting value might differ across different openssl versions for the same X509 certificate.
:
X509_subject_name_hash

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sort of a checksum of subject name of X509 certificate . The result is not a full hash (e.g. sha-1), it is kind-of-a-hash truncated to the size of 'unsigned long' (32 bits). The resulting value might differ across different openssl versions for the same X509 certificate.
:
X509_pubkey_digest

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Computes digest/fingerprint of public key from X509 certificate using hash function.
:
X509_set_issuer_name

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets issuer of X509 certificate to .
:
X509_set_pubkey

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets public key of X509 certificate to .
:
X509_set_serialNumber

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets serial number of X509 certificate to .
:
X509_set_subject_name

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets subject of X509 certificate to .
:
X509_set_version

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Set 'version' value for X509 certificate $ to .
:
X509_sign

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sign X509 certificate with private key (using digest algorithm ).
:
X509_verify

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Verifies X509 object using public key (pubkey of issuing CA).
:
X509_get_ext_count

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns the total number of extensions in X509 object .
:
X509_get_pubkey

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns public key corresponding to given X509 object .
:
X509_get_serialNumber

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns serial number of X509 certificate .

See ``P_ASN1_INTEGER_get_dec, ``P_ASN1_INTEGER_get_hex or `ASN1_INTEGER_get'' to decode ASN1_INTEGER object.

:

X509_get_version

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns 'version' value of given X509 certificate .
:
X509_get_ext
Returns X509_EXTENSION from based on given position/index.
:
X509_get_ext_by_NID
Returns X509_EXTENSION from based on given NID.
:
X509_get_fingerprint
Returns fingerprint of certificate .
NOTE: Does not exactly correspond to any low level API function. The implementation is basen on openssl's .
:
X509_get_issuer_name
Return an X509_NAME object representing the issuer of the certificate .
:
X509_get_notAfter
Return an object giving the time after which the certificate is not valid.

To get human readable/printable form the return value you can use:

:
X509_get_notBefore
Return an object giving the time before which the certificate is not valid

To get human readable/printable form the return value you can use:

:
X509_get_subjectAltNames

NOTE: Does not exactly correspond to any low level API function.

Returns the list of alternative subject names from X509 certificate .

Note: type 7 - GEN_IPADD contains the IP address as a packed binary address.

:

X509_get_subject_name
Returns the subject of the certificate .
:
X509_gmtime_adj

Adjust th ASN1_TIME object to the timestamp (in GMT).

BEWARE: this function may fail for dates after 2038 as it is dependent on time_t size on your system (32bit time_t does not work after 2038). Consider using ``P_ASN1_TIME_set_isotime'' instead).

:

X509_load_cert_crl_file

Takes PEM file and loads all X509 certificates and X509 CRLs from that file into X509_LOOKUP structure.

:
X509_load_cert_file
Loads/adds X509 certificate from to X509_LOOKUP structure
:
X509_load_crl_file
Loads/adds X509 CRL from to X509_LOOKUP structure
:
X509_policy_level_get0_node

??? (more info needed)

:
X509_policy_level_node_count

??? (more info needed)

:
X509_policy_node_get0_parent

??? (more info needed)

:
X509_policy_node_get0_policy

??? (more info needed)

:
X509_policy_node_get0_qualifiers

??? (more info needed)

:
X509_policy_tree_free

??? (more info needed)

:
X509_policy_tree_get0_level

??? (more info needed)

:
X509_policy_tree_get0_policies

??? (more info needed)

:
X509_policy_tree_get0_user_policies

??? (more info needed)

:
X509_policy_tree_level_count

??? (more info needed)

:
X509_verify_cert_error_string
Returns a human readable error string for verification error .

Check openssl doc <http://www.openssl.org/docs/crypto/X509_STORE_CTX_get_error.html>

:

P_X509_add_extensions

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Adds one or more X509 extensions to X509 object .

You can set more extensions at once:

:
P_X509_copy_extensions

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Copies X509 extensions from X509_REQ object to X509 object - handy when you need to turn X509_REQ into X509 certificate.

:
P_X509_get_crl_distribution_points

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Get the list of CRL distribution points from X509 certificate.

:
P_X509_get_ext_key_usage

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Gets the list of extended key usage of given X509 certificate .

Examples:

:
P_X509_get_key_usage

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Gets the list of key usage of given X509 certificate .
:
P_X509_get_netscape_cert_type

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Gets the list of Netscape cert types of given X509 certificate .
:
P_X509_get_pubkey_alg

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns ASN1_OBJECT corresponding to X509 certificate public key algorithm.

To get textual representation use:

:
P_X509_get_signature_alg

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns ASN1_OBJECT corresponding to X509 signarite key algorithm.

To get textual representation use:

:

Low level API: X509_REQ_* related functions

X509_REQ_new

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Creates a new X509_REQ structure.

:
X509_REQ_free

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Free an allocated X509_REQ structure.

:
X509_REQ_add1_attr_by_NID

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Adds an attribute whose name is defined by a NID . The field value to be added is in .
:
X509_REQ_digest

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Computes digest/fingerprint of X509_REQ using hash function.
:
X509_REQ_get_attr_by_NID

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Retrieve the next index matching after ($lastpos should initially be set to -1).

Note: use ``P_X509_REQ_get_attr'' to get the actual attribute value - e.g.

:
X509_REQ_get_attr_by_OBJ

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Retrieve the next index matching after ($lastpos should initially be set to -1).

Note: use ``P_X509_REQ_get_attr'' to get the actual attribute value - e.g.

:
X509_REQ_get_attr_count

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns the total number of attributes in .
:
X509_REQ_get_pubkey

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns public key corresponding to given X509_REQ object .
:
X509_REQ_get_subject_name

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns X509_NAME object corresponding to subject name of given X509_REQ object .
:
X509_REQ_get_version

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns 'version' value for given X509_REQ object .
:
X509_REQ_set_pubkey

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets public key of given X509_REQ object to .
:
X509_REQ_set_subject_name

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets subject name of given X509_REQ object to X509_NAME object .
:
X509_REQ_set_version

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sets 'version' of given X509_REQ object to .
:
X509_REQ_sign

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sign X509_REQ object with private key (using digest algorithm ).
:
X509_REQ_verify

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Verifies X509_REQ object using public key (pubkey of requesting party).
:
P_X509_REQ_add_extensions

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Adds one or more X509 extensions to X509_REQ object .

You can set more extensions at once:

my $rv = Net::SSLeay::P_X509_REQ_add_extensions($x509_req, &Net::SSLeay::NID_key_usage => 'digitalSignature,keyEncipherment', &Net::SSLeay::NID_basic_constraints => 'CA:FALSE', &Net::SSLeay::NID_ext_key_usage => 'serverAuth,clientAuth', &Net::SSLeay::NID_netscape_cert_type => 'server', &Net::SSLeay::NID_subject_alt_name => 'DNS:s1.com,DNS:s2.com', &Net::SSLeay::NID_crl_distribution_points => 'URI:http://pki.com/crl1,URI:http://pki.com/crl2', );

@] :

P_X509_REQ_get_attr

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Returns attribute value for X509_REQ's attribute at index .
:

Low level API: X509_CRL_* related functions

X509_CRL_new

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Creates a new X509_CRL structure.

:
X509_CRL_free

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Free an allocated X509_CRL structure.

:
X509_CRL_digest

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Computes digest/fingerprint of X509_CRL using hash function.

Example:

:
X509_CRL_get_ext

COMPATIBILITY: not available in Net-SSLeay-1.54 and before

Returns X509_EXTENSION from based on given position/index.
:
X509_CRL_get_ext_by_NID

COMPATIBILITY: not available in Net-SSLeay-1.54 and before

Returns X509_EXTENSION from based on given NID.
:
X509_CRL_get_ext_count

COMPATIBILITY: not available in Net-SSLeay-1.54 and before

Returns the total number of extensions in X509_CRL object .
:
X509_CRL_get_issuer

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns X509_NAME object corresponding to the issuer of X509_CRL .
See other functions to get more info from X509_NAME structure.

:

X509_CRL_get_lastUpdate

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns 'lastUpdate' date-time value of X509_CRL object .
:
X509_CRL_get_nextUpdate

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns 'nextUpdate' date-time value of X509_CRL object .
:
X509_CRL_get_version

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns 'version' value of given X509_CRL structure .
:
X509_CRL_set_issuer_name

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Sets the issuer of X509_CRL object to X509_NAME object .
:
X509_CRL_set_lastUpdate

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Sets 'lastUpdate' value of X509_CRL object to .
:
X509_CRL_set_nextUpdate

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Sets 'nextUpdate' value of X509_CRL object to .
:
X509_CRL_set_version

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Sets 'version' value of given X509_CRL structure to .
Note that if you want to use any X509_CRL extension you need to set ``version 2 CRL'' - .

:

X509_CRL_sign

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Sign X509_CRL object with private key (using digest algorithm ).
:
X509_CRL_sort

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Sorts the data of X509_CRL object so it will be written in serial number order.

:
X509_CRL_verify

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Verifies X509_CRL object using public key (pubkey of issuing CA).
:
P_X509_CRL_add_revoked_serial_hex

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Adds given serial number to X509_CRL object .
:
P_X509_CRL_get_serial

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Returns serial number of X509_CRL object.

:
P_X509_CRL_set_serial

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.7

Sets serial number of X509_CRL object to .
:

Low level API: X509_EXTENSION_* related functions

X509_EXTENSION_get_critical

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns 'critical' flag of given X509_EXTENSION object .
:
X509_EXTENSION_get_data

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns value (raw data) of X509_EXTENSION object .

Note: you can use ``P_ASN1_STRING_get'' to convert ASN1_OCTET_STRING into perl scalar variable.

:

X509_EXTENSION_get_object

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns OID (ASN1_OBJECT) of X509_EXTENSION object .
:
X509V3_EXT_print

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns string representation of given X509_EXTENSION object .
:
X509V3_EXT_d2i

Parses an extension and returns its internal structure.

:

Low level API: X509_NAME_* related functions

X509_NAME_ENTRY_get_data

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Retrieves the field value of in and ASN1_STRING structure.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_ENTRY_get_object.html>

:

X509_NAME_ENTRY_get_object

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Retrieves the field name of in and ASN1_OBJECT structure.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_ENTRY_get_object.html>

:

X509_NAME_new

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.5

Creates a new X509_NAME structure. Adds a field whose name is defined by a string . The field value to be added is in .
:
X509_NAME_hash

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.5

Sort of a checksum of issuer name . The result is not a full hash (e.g. sha-1), it is kind-of-a-hash truncated to the size of 'unsigned long' (32 bits). The resulting value might differ across different openssl versions for the same X509 certificate.
:
X509_NAME_add_entry_by_txt

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.5

Adds a field whose name is defined by a string . The field value to be added is in .
Unicode note: when passing non-ascii (unicode) string in do not forget to set and encode the perl via .

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_add_entry_by_txt.html>

:

X509_NAME_add_entry_by_NID

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.5

Adds a field whose name is defined by a NID . The field value to be added is in .

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_add_entry_by_txt.html>

:

X509_NAME_add_entry_by_OBJ

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-0.9.5

Adds a field whose name is defined by a object (OID) . The field value to be added is in .

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_add_entry_by_txt.html>

:

X509_NAME_cmp

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Compares two X509_NAME obejcts.

:
X509_NAME_digest

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Computes digest/fingerprint of X509_NAME using hash function.
:
X509_NAME_entry_count

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns the total number of entries in .

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_get_index_by_NID.html>

:

X509_NAME_get_entry

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Retrieves the X509_NAME_ENTRY from corresponding to index . Acceptable values for run from 0 to . The value returned is an internal pointer which must not be freed.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_get_index_by_NID.html>

:

X509_NAME_print_ex

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns a string with human readable version of .

Most likely you will be fine with default:

Or you might want RFC2253-like output without utf8 chars escaping:

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_print_ex.html>

:

X509_NAME_get_text_by_NID
Retrieves the text from the first entry in name which matches , if no such entry exists -1 is returned.

openssl note: this is a legacy function which has various limitations which makes it of minimal use in practice. It can only find the first matching entry and will copy the contents of the field verbatim: this can be highly confusing if the target is a multicharacter string type like a BMPString or a UTF8String.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_get_index_by_NID.html>

:

X509_NAME_oneline
Return an ASCII version of .

Check openssl doc <http://www.openssl.org/docs/crypto/X509_NAME_print_ex.html>

:

sk_X509_NAME_free

Free an allocated STACK_OF(X509_NAME) structure.

:
sk_X509_NAME_num

Return number of items in STACK_OF(X509_NAME)

:
sk_X509_NAME_value
Returns X509_NAME from position in STACK_OF(X509_NAME)
:
add_file_cert_subjects_to_stack
Add a file of certs to a stack. All certs in that are not already in the will be added.
:
add_dir_cert_subjects_to_stack
Add a directory of certs to a stack. All certs in that are not already in the will be added.
:

Low level API: X509_STORE_* related functions

X509_STORE_CTX_get_current_cert

Returns the certificate in ctx which caused the error or 0 if no certificate is relevant.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_STORE_CTX_get_error.html>

:

X509_STORE_CTX_get_error
Returns the error code of .

For more info about erro code values check function ``get_verify_result''.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_STORE_CTX_get_error.html>

:

X509_STORE_CTX_get_error_depth

Returns the depth of the error. This is a non-negative integer representing where in the certificate chain the error occurred. If it is zero it occurred in the end entity certificate, one if it is the certificate which signed the end entity certificate and so on.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_STORE_CTX_get_error.html>

:

X509_STORE_CTX_get_ex_data
Is used to retrieve the information for from .
:
X509_STORE_CTX_set_ex_data
Is used to store application data at arg for idx into .
:
X509_STORE_CTX_set_cert
Sets the certificate to be verified in to .

Check openssl doc <http://www.openssl.org/docs/crypto/X509_STORE_CTX_new.html>

:

X509_STORE_CTX_set_error
Sets the error code of to . For example it might be used in a verification callback to set an error based on additional checks.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_STORE_CTX_get_error.html>

:

X509_STORE_add_cert
Adds X509 certificate into the X509_STORE .
:
X509_STORE_add_crl
Adds X509 CRL into the X509_STORE .
:
X509_STORE_set1_param

??? (more info needed)

:
X509_STORE_set_flags
:
X509_STORE_set_purpose
For more details about identifier check ``CTX_set_purpose''.

:

X509_STORE_set_trust
For more details about identifier check ``CTX_set_trust''.

:

Low level API: X509_VERIFY_PARAM_* related functions

X509_VERIFY_PARAM_add0_policy
Enables policy checking (it is disabled by default) and adds to the acceptable policy set.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_add0_table

??? (more info needed)

:
X509_VERIFY_PARAM_clear_flags
Clears the flags in param.
For more details about bitmask see ``X509_STORE_set_flags''.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_free

Frees up the X509_VERIFY_PARAM structure.

:
X509_VERIFY_PARAM_get_depth

Returns the current verification depth.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_get_flags

Returns the current verification flags.

For more details about returned flags bitmask see ``X509_STORE_set_flags''.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_set_flags
For more details about bitmask see ``X509_STORE_set_flags''.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_inherit

??? (more info needed)

:
X509_VERIFY_PARAM_lookup

Finds X509_VERIFY_PARAM by name.

:
X509_VERIFY_PARAM_new

Creates a new X509_VERIFY_PARAM structure.

:
X509_VERIFY_PARAM_set1
Sets the name of X509_VERIFY_PARAM structure to the same value as the name of X509_VERIFY_PARAM structure .
:
X509_VERIFY_PARAM_set1_name
Sets the name of X509_VERIFY_PARAM structure to .
:
X509_VERIFY_PARAM_set1_policies

Enables policy checking (it is disabled by default) and sets the acceptable policy set to policies. Any existing policy set is cleared. The policies parameter can be 0 to clear an existing policy set.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_set_depth

Sets the maximum verification depth to depth. That is the maximum number of untrusted CA certificates that can appear in a chain.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_set_purpose
Sets the verification purpose in to . This determines the acceptable purpose of the certificate chain, for example SSL client or SSL server.
For more details about identifier check ``CTX_set_purpose''.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_set_time
Sets the verification time in to . Normally the current time is used.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_set_trust
Sets the trust setting in to .
For more details about identifier check ``CTX_set_trust''.

Check openssl doc <http://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html>

:

X509_VERIFY_PARAM_table_cleanup

??? (more info needed)

:

Low level API: Cipher (EVP_CIPHER_*) related functions

EVP_get_cipherbyname

COMPATIBILITY: not available in Net-SSLeay-1.45 and before

Returns an EVP_CIPHER structure when passed a cipher name.

Check openssl doc <http://www.openssl.org/docs/crypto/EVP_EncryptInit.html>

:

Low level API: Digest (EVP_MD_*) related functions

OpenSSL_add_all_digests

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

http://www.openssl.org/docs/crypto/OpenSSL_add_all_algorithms.html

:

P_EVP_MD_list_all

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-1.0.0

NOTE: Does not exactly correspond to any low level API function

The returned digest names correspond to values expected by ``EVP_get_digestbyname''.

Note that some of the digests are available by default and some only after calling `OpenSSL_add_all_digests''.

:

EVP_get_digestbyname

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

The param can be:

Or better check the supported digests by calling ``P_EVP_MD_list_all''.

:

EVP_MD_type

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

:
EVP_MD_size

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

:
EVP_MD_CTX_md

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

:
EVP_MD_CTX_create

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

Allocates, initializes and returns a digest context.

The complete idea behind EVP_MD_CTX looks like this example:

:
EVP_DigestInit_ex

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

Sets up digest context to use a digest from ENGINE , must be initialized before calling this function, type will typically be supplied by a function such as ``EVP_get_digestbyname''. If is 0 then the default implementation of digest is used.
:
EVP_DigestInit

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

Behaves in the same way as ``EVP_DigestInit_ex'' except the passed context does not have to be initialized, and it always uses the default digest implementation.
:
EVP_MD_CTX_destroy

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

Cleans up digest context and frees up the space allocated to it, it should be called only on a context created using ``EVP_MD_CTX_create''.
:
EVP_DigestUpdate

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

:
EVP_DigestFinal_ex

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

Retrieves the digest value from . After calling ``EVP_DigestFinal_ex no additional calls to ``EVP_DigestUpdate can be made, but ``EVP_DigestInit_ex'' can be called to initialize a new digest operation.
:
EVP_DigestFinal

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

Similar to ``EVP_DigestFinal_ex'' except the digest context ctx is automatically cleaned up.

:
MD2

COMPATIBILITY: no supported by default in openssl-1.0.0

Computes MD2 from given (all data needs to be loaded into memory)
:
MD4
Computes MD4 from given (all data needs to be loaded into memory)
:
MD5
Computes MD5 from given (all data needs to be loaded into memory)
:
RIPEMD160
Computes RIPEMD160 from given (all data needs to be loaded into memory)
:
SHA1

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

Computes SHA1 from given (all data needs to be loaded into memory)
:
SHA256

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.8

Computes SHA256 from given (all data needs to be loaded into memory)
:
SHA512

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.8

Computes SHA512 from given (all data needs to be loaded into memory)
:
EVP_Digest

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.7

Computes ``any'' digest from given (all data needs to be loaded into memory)
:
EVP_sha1

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

:
EVP_sha256

COMPATIBILITY: requires at least openssl-0.9.8

:
EVP_sha512

COMPATIBILITY: not available in Net-SSLeay-1.42 and before; requires at least openssl-0.9.8

:
EVP_add_digest
:

Low level API: CIPHER_* related functions

CIPHER_get_name

COMPATIBILITY: not available in Net-SSLeay-1.42 and before

Returns name of the cipher used.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CIPHER_get_name.html>

Example:

:
CIPHER_description

Returns a textual description of the cipher used.

??? (does this function really work?)

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CIPHER_get_name.html>

:

CIPHER_get_bits

Returns the number of secret bits used for cipher.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_CIPHER_get_name.html>

:

Low level API: RSA_* related functions

RSA_generate_key

Generates a key pair and returns it in a newly allocated RSA structure. The pseudo-random number generator must be seeded prior to calling RSA_generate_key.

Check openssl doc <http://www.openssl.org/docs/crypto/RSA_generate_key.html>

:

RSA_free

Frees the RSA structure and its components. The key is erased before the memory is returned to the system.

Check openssl doc <http://www.openssl.org/docs/crypto/RSA_new.html>

:

Low level API: BIO_* related functions

BIO_eof

Returns 1 if the BIO has read EOF, the precise meaning of 'EOF' varies according to the BIO type.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_ctrl.html>

:

BIO_f_ssl

Returns the SSL BIO method. This is a filter BIO which is a wrapper round the OpenSSL SSL routines adding a BIO 'flavour' to SSL I/O.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_f_ssl.html>

:

BIO_free

Frees up a single BIO.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_new.html>

:

BIO_new
Returns a new BIO using method

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_new.html>

:

BIO_new_buffer_ssl_connect

Creates a new BIO chain consisting of a buffering BIO, an SSL BIO (using ctx) and a connect BIO.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_f_ssl.html>

:

BIO_new_file
Creates a new file BIO with mode the meaning of mode is the same as the stdio function fopen(). The BIO_CLOSE flag is set on the returned BIO.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_s_file.html>

:

BIO_new_ssl

Allocates an SSL BIO using SSL_CTX ctx and using client mode if client is non zero.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_f_ssl.html>

:

BIO_new_ssl_connect

Creates a new BIO chain consisting of an SSL BIO (using ctx) followed by a connect BIO.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_f_ssl.html>

:

BIO_pending

Return the number of pending characters in the BIOs read buffers.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_ctrl.html>

:

BIO_wpending

Return the number of pending characters in the BIOs write buffers.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_ctrl.html>

:

BIO_read

Read the underlying descriptor.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_read.html>

:

BIO_write
Attempts to write data from to BIO .

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_read.html>

:

BIO_s_mem

Return the memory BIO method function.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_s_mem.html>

:

BIO_ssl_copy_session_id

Copies an SSL session id between BIO chains from and to. It does this by locating the SSL BIOs in each chain and calling SSL_copy_session_id() on the internal SSL pointer.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_f_ssl.html>

:

BIO_ssl_shutdown

Closes down an SSL connection on BIO chain bio. It does this by locating the SSL BIO in the chain and calling SSL_shutdown() on its internal SSL pointer.

Check openssl doc <http://www.openssl.org/docs/crypto/BIO_f_ssl.html>

:

Low level API: Server side Server Name Indication ('SNI') support

set_tlsext_host_name

TBA

:

get_servername

TBA

:

get_servername_type

TBA

:

CTX_set_tlsext_servername_callback

COMPATIBILITY: requires at least OpenSSL 0.9.8f

This function is used in a server to support Server side Server Name Indication (SNI).

On the server side: Set up an additional SSL_CTX() for each different certificate;

Add a servername callback to each SSL_CTX() using CTX_set_tlsext_servername_callback();

The callback function is required to retrieve the client-supplied servername with get_servername(ssl). Figure out the right SSL_CTX to go with that host name, then switch the SSL object to that SSL_CTX with set_SSL_CTX().

Example:

More complete example:

:

Low level API: NPN (next protocol negotiation) related functions

NPN is being replaced with ALPN, a more recent TLS extension for application protocol negotiation that's in process of being adopted by IETF. Please look below for APLN API description.

Simple approach for using NPN support looks like this:

Please note that the selection (negotiation) is performed by client side, the server side simply advertise the list of supported protocols.

Advanced approach allows you to implement your own negotiation algorithm.

Detection of NPN support (works even in older Net::SSLeay versions):

CTX_set_next_proto_select_cb

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-1.0.1

NOTE: You need CTX_set_next_proto_select_cb on client side of SSL connection.

Simple usage - in this case a ``common'' negotiation algorithm (as implemented by openssl's function SSL_select_next_proto) is used.

Advanced usage (you probably do not need this):

To undefine/clear this callback use:

:
CTX_set_next_protos_advertised_cb

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-1.0.1

NOTE: You need CTX_set_next_proto_select_cb on server side of SSL connection.

Simple usage:

Advanced usage (you probably do not need this):

To undefine/clear this callback use:

:
P_next_proto_negotiated

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-1.0.1

Returns the name of negotiated protocol for given SSL connection .
:
P_next_proto_last_status

COMPATIBILITY: not available in Net-SSLeay-1.45 and before; requires at least openssl-1.0.1

Returns the result of the last negotiation for given SSL connection .
:

Low level API: ALPN (application layer protocol negotiation) related functions

Application protocol can be negotiated via two different mechanisms employing two different TLS extensions: NPN (obsolete) and ALPN (recommended).

The API is rather similar, with slight differences reflecting protocol specifics. In particular, with ALPN the protocol negotiation takes place on server, while with NPN the client implements the protocol negotiation logic.

With ALPN, the most basic implementation looks like this:

Advanced approach allows you to implement your own negotiation algorithm.

Detection of ALPN support (works even in older Net::SSLeay versions):

CTX_set_alpn_select_cb

COMPATIBILITY: not available in Net-SSLeay-1.55 and before; requires at least openssl-1.0.2

NOTE: You need CTX_set_alpn_select_cb on server side of TLS connection.

Simple usage - in this case a ``common'' negotiation algorithm (as implemented by openssl's function SSL_select_next_proto) is used.

Advanced usage (you probably do not need this):

To undefine/clear this callback use:

:
set_alpn_protos

COMPATIBILITY: not available in Net-SSLeay-1.55 and before; requires at least openssl-1.0.2

NOTE: You need set_alpn_protos on client side of TLS connection.

This adds list of supported application layer protocols to ClientHello message sent by a client. It advertises the enumeration of supported protocols:

:
CTX_set_alpn_protos

COMPATIBILITY: not available in Net-SSLeay-1.55 and before; requires at least openssl-1.0.2

NOTE: You need CTX_set_alpn_protos on client side of TLS connection.

This adds list of supported application layer protocols to ClientHello message sent by a client. It advertises the enumeration of supported protocols:

:
P_alpn_selected

COMPATIBILITY: not available in Net-SSLeay-1.55 and before; requires at least openssl-1.0.2

Returns the name of negotiated protocol for given TLS connection .
:

Low level API: DANE Support

OpenSSL version 1.0.2 adds preliminary support RFC6698 Domain Authentication of Named Entities (DANE) Transport Layer Association within OpenSSL

SSL_get_tlsa_record_byname

COMPATIBILITY: DELETED from net-ssleay, since it is not supported by OpenSSL

In order to facilitate DANE there is additional interface, SSL_get_tlsa_record_byname, accepting hostname, port and socket type that returns packed TLSA record. In order to make it even easier there is additional SSL_ctrl function that calls SSL_get_tlsa_record_byname for you. Latter is recommended for programmers that wish to maintain broader binary compatibility, e.g. make application work with both 1.0.2 and prior version (in which case call to SSL_ctrl with new code returning error would have to be ignored when running with prior version).

Net::SSLeay::get_tlsa_record_byname($name, , );

:

Low level API: Other functions

COMP_add_compression_method

Adds the compression method cm with the identifier id to the list of available compression methods. This list is globally maintained for all SSL operations within this application. It cannot be set for specific SSL_CTX or SSL objects.

Check openssl doc <http://www.openssl.org/docs/ssl/SSL_COMP_add_compression_method.html>

:

DH_free

Frees the DH structure and its components. The values are erased before the memory is returned to the system.

Check openssl doc <http://www.openssl.org/docs/crypto/DH_new.html>

:

FIPS_mode_set

Enable or disable FIPS mode in a FIPS capable OpenSSL.

:

Low level API: EC related functions

CTX_set_tmp_ecdh

TBA

:

EC_KEY_free

TBA

:

EC_KEY_new_by_curve_name

TBA

:

Constants

There are many openssl constants available in Net::SSLeay. You can use them like this:

Or you can import them and use:

The constants names are derived from openssl constants, however constants starting with prefix have name with part stripped - e.g. openssl's constant is available as

The list of all available constant names:

INTERNAL ONLY functions (do not use these)

The following functions are not intended for use from outside of Net::SSLeay module. They might be removed, renamed or changed without prior notice in future version.

Simply DO NOT USE THEM!

hello:
blength:
constant:

EXAMPLES

One very good example to look at is the implementation of in the file.

The following is a simple SSLeay client (with too little error checking :-(

The following is a simple SSLeay echo server (non forking):

Yet another echo server. This one runs from so it avoids all the socket code overhead. Only caveat is opening an rsa key file - it had better be without any encryption or else it will not know where to ask for the password. Note how and are wired to SSL.

There are also a number of example/test programs in the examples directory:

LIMITATIONS

uses an internal buffer of 32KB, thus no single read will return more. In practice one read returns much less, usually as much as fits in one network packet. To work around this, you should use a loop like this:
Although there is no built-in limit in , the network packet size limitation applies here as well, thus use:

Or alternatively you can just use the following convenience functions:

KNOWN BUGS AND CAVEATS

Autoloader emits a

warning if die_if_ssl_error is made autoloadable. If you figure out why, drop me a line.

Callback set using does not appear to work. This may well be an openssl problem (e.g. see line 1029). Try using instead and do not be surprised if even this stops working in future versions.

Callback and certificate verification stuff is generally too little tested.

Random numbers are not initialized randomly enough, especially if you do not have and/or (such as in Solaris platforms - but it's been suggested that cryptorand daemon from the SUNski package solves this). In this case you should investigate third party software that can emulate these devices, e.g. by way of a named pipe to some program.
Another gotcha with random number initialization is randomness depletion. This phenomenon, which has been extensively discussed in OpenSSL, Apache-SSL, and Apache-mod_ssl forums, can cause your script to block if you use or to operate insecurely if you use . What happens is that when too much randomness is drawn from the operating system's randomness pool then randomness can temporarily be unavailable. solves this problem by waiting until enough randomness can be gathered - and this can take a long time since blocking reduces activity in the machine and less activity provides less random events: a vicious circle. solves this dilemma more pragmatically by simply returning predictable ``random'' numbers. Some emulation software however actually seems to implement semantics. Caveat emptor.

I've been pointed to two such daemons by Mik Firestone <mik@@speed.stdio._com> who has used them on Solaris 8:

1.
Entropy Gathering Daemon (EGD) at <http://www.lothar.com/tech/crypto/>:
2.
Pseudo-random number generating daemon (PRNGD) at <http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html>:

If you are using the low level API functions to communicate with other SSL implementations, you would do well to call

to cope with some well know bugs in some other SSL implementations. The high level API functions always set all known compatibility options.

Sometimes (and the high level HTTPS functions that build on it) is too fast in signaling the EOF to legacy HTTPS servers. This causes the server to return empty page. To work around this problem you can set the global variable

HTTP/1.1 is not supported. Specifically this module does not know to issue or serve multiple http requests per connection. This is a serious shortcoming, but using the SSL session cache on your server helps to alleviate the CPU load somewhat.

As of version 1.09 many newer OpenSSL auxiliary functions were added (from onwards in ). Unfortunately I have not had any opportunity to test these. Some of them are trivial enough that I believe they ``just work'', but others have rather complex interfaces with function pointers and all. In these cases you should proceed wit great caution.

This module defaults to using OpenSSL automatic protocol negotiation code for automatically detecting the version of the SSL protocol that the other end talks. With most web servers this works just fine, but once in a while I get complaints from people that the module does not work with some web servers. Usually this can be solved by explicitly setting the protocol version, e.g.

Although the autonegotiation is nice to have, the SSL standards do not formally specify any such mechanism. Most of the world has accepted the SSLeay/OpenSSL way of doing it as the de facto standard. But for the few that think differently, you have to explicitly speak the correct version. This is not really a bug, but rather a deficiency in the standards. If a site refuses to respond or sends back some nonsensical error codes (at the SSL handshake level), try this option before mailing me.

On some systems, OpenSSL may be compiled without support for SSLv2. If this is the case, Net::SSLeay will warn if ssl_version has been set to 2.

The high level API returns the certificate of the peer, thus allowing one to check what certificate was supplied. However, you will only be able to check the certificate after the fact, i.e. you already sent your form data by the time you find out that you did not trust them, oops.

So, while being able to know the certificate after the fact is surely useful, the security minded would still choose to do the connection and certificate verification first and only then exchange data with the site. Currently none of the high level API functions do this, thus you would have to program it using the low level API. A good place to start is to see how the function is implemented.
The high level API functions use a global file handle internally. This really should not be a problem because there is no way to interleave the high level API functions, unless you use threads (but threads are not very well supported in perl anyway (as of version 5.6.1). However, you may run into problems if you call undocumented internal functions in an interleaved fashion. The best solution is to ``require Net::SSLeay'' in one thread after all the threads have been created.

DIAGNOSTICS

Random number generator not seeded!!!
(W) This warning indicates that was not able to read or , possibly because your system does not have them or they are differently named. You can still use SSL, but the encryption will not be as strong.:
open_tcp_connection
destination host not found:`server' (port 123) ($!):Name lookup for host named failed.:
open_tcp_connection
failed `server', 123 ($!):The name was resolved, but establishing the TCP connection failed.:
msg 123
1 - error:140770F8:SSL routines:SSL23_GET_SERVER_HELLO:unknown proto:SSLeay error string. The first number (123) is the PID, the second number (1) indicates the position of the error message in SSLeay error stack. You often see a pile of these messages as errors cascade.:
msg 123
1 - error:02001002::lib?(2) :func?(1) :reason?(2):The same as above, but you didn't call load_error_strings() so SSLeay couldn't verbosely explain the error. You can still find out what it means with this command:
:
Password is being asked for private key
This is normal behaviour if your private key is encrypted. Either you have to supply the password or you have to use an unencrypted private key. Scan OpenSSL.org for the FAQ that explains how to do this (or just study examples/makecert.pl which is used during to do just that).:

SECURITY

You can mitigate some of the security vulnerabilities that might be present in your SSL/TLS application:

BEAST Attack

http://blogs.cisco.com/security/beat-the-beast-with-tls/ https://community.qualys.com/blogs/securitylabs/2011/10/17/mitigating-the-beast-attack-on-tls http://blog.zoller.lu/2011/09/beast-summary-tls-cbc-countermeasures.html

The BEAST attack relies on a weakness in the way CBC mode is used in SSL/TLS. In OpenSSL versions 0.9.6d and later, the protocol-level mitigation is enabled by default, thus making it not vulnerable to the BEAST attack.

Solutions:

Compile with OpenSSL versions 0.9.6d or later, which enables SSL_OP_ALL by default:
Ensure SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS is not enabled (its not enabled by default):
Don't support SSLv2, SSLv3:
Actively control the ciphers your server supports with set_cipher_list::

Net::SSLeay::set_cipher_list($ssl, 'RC4-SHA:HIGH:!ADH');

Session Resumption

http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html

The SSL Labs vulnerability test on your SSL server might report in red:

Session resumption No (IDs assigned but not accepted)

This report is not really bug or a vulnerability, since the server will not accept session resumption requests. However, you can prevent this noise in the report by disabling the session cache altogether: Net::SSLeay::CTX_set_session_cache_mode($ssl_ctx, 0);

Secure Renegotiation and DoS Attack

https://community.qualys.com/blogs/securitylabs/2011/10/31/tls-renegotiation-and-denial-of-service-attacks

This is not a ``security flaw,'' it is more of a DoS vulnerability.

Solutions:

Do not support SSLv2:
Do not set the SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION option:
Compile with OpenSSL 0.9.8m or later:

BUGS AND SUPPORT

Please report any bugs or feature requests to , or through the web interface at <http://rt.cpan.org/Public/Dist/Display.html?Name=Net-SSLeay>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

Subversion access to the latest source code etc can be obtained at <http://alioth.debian.org/projects/net-ssleay>

The developer mailing list (for people interested in contributing to the source code) can be found at <http://lists.alioth.debian.org/mailman/listinfo/net-ssleay-devel>

You can find documentation for this module with the command.

You can also look for information at:

AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/Net-SSLeay>

:

CPAN Ratings

<http://cpanratings.perl.org/d/Net-SSLeay>

:

Search CPAN

<http://search.cpan.org/dist/Net-SSLeay>

:

Commercial support for Net::SSLeay may be obtained from

Symlabs ([email protected]) Tel: +351-214.222.630 Fax: +351-214.222.637

@]

AUTHOR

Maintained by Mike McCauley and Florian Ragwitz since November 2005

Originally written by Sampo Kelloma.ki <[email protected]>

COPYRIGHT

Copyright (c) 1996-2003 Sampo Kelloma.ki <[email protected]>

Copyright (C) 2005-2006 Florian Ragwitz <[email protected]>

Copyright (C) 2005 Mike McCauley <[email protected]>

All Rights Reserved.

Distribution and use of this module is under the same terms as the OpenSSL package itself (i.e. free, but mandatory attribution; NO WARRANTY). Please consult LICENSE file in the root of the OpenSSL distribution, and also included in this distribution.

While the source distribution of this perl module does not contain Eric's or OpenSSL's code, if you use this module you will use OpenSSL library. Please give Eric and OpenSSL team credit (as required by their licenses).

And remember, you, and nobody else but you, are responsible for auditing this module and OpenSSL library for security problems, backdoors, and general suitability for your application.

LICENSE

See the LICENSE file included in this distribution

(ignore this line: this is to keep kwalitee happy by saying: Not GPL)

SEE ALSO

Net::SSLeay::Handle - File handle interface ./examples - Example servers and a clients <http://www.openssl.org/> - OpenSSL source, documentation, etc [email protected] - General OpenSSL mailing list <http://www.ietf.org/rfc/rfc2246.txt> - TLS 1.0 specification <http://www.w3c.org> - HTTP specifications <http://www.ietf.org/rfc/rfc2617.txt> - How to send password <http://www.lothar.com/tech/crypto/> - Entropy Gathering Daemon (EGD) <http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html> - pseudo-random number generating daemon (PRNGD) perl?(1) perlref?(1) perllol?(1) perldoc ~openssl/doc/ssl/SSL_CTX_set_verify.pod

@]


Index

NAME

SYNOPSIS

DESCRIPTION

High level functions for accessing web servers

Certificate verification and Certificate Revocation Lists (CRLs)

Certificate verification and Online Status Revocation Protocol (OCSP)

Using Net::SSLeay in multi-threaded applications

Convenience routines

Initialization

Error handling functions

Sockets

Callbacks

Low level API

Constants

INTERNAL ONLY functions (do not use these)

EXAMPLES

LIMITATIONS

KNOWN BUGS AND CAVEATS

DIAGNOSTICS

SECURITY

BEAST Attack

Session Resumption

Secure Renegotiation and DoS Attack

BUGS AND SUPPORT

AUTHOR

COPYRIGHT

LICENSE

SEE ALSO