NAME

Net::NSS::SSL - SSL sockets using NSS

SYNOPSIS

INTERFACE

CLASS METHODS

new ( ADDR, %ARGS ) : Net::NSS::SSL =item new ( %ARGS ) : Net::NSS::SSL

Creates a new socket, sets it up correctly, imports it into NSS SSL layer and optionally if it's a client-side socket connect to the remote host.

create_socket ( TYPE ) : Net::NSS::SSL

Creates a new socket of the TYPE tcp or udp. Does not set any socket options nor imports it into the SSL layer. You probablly want to use new instead of this method.

INSTANCE METHODS

connect ( HOST, PORT, [ TIMEOUT ] )

Conencts to the host HOST on the given PORT. The optional argument TIMEOUT sets how many seconds connect has to complete the connection setup. If ommited PR_INTERVAL_NO_TIMEOUT is used.

bind ( HOST, PORT )

Binds an network address (HOST + PORT) to the socket.

listen ( [ QUEUE_LENGTH ] )

Listens for connections on the socket. The optional argument QUEUE_LENGTH is the maximum length of the queue of pending connections. Defaults to 10.

accept ( [ TIMEOUT ] ) : Net::NSS::SSL

Accepts a connection on the socket and returns the new socket used to communicate with the connected client. The optional argument TIMEOUT specified determined how long the connection setup might take. If ommited PR_INTERVAL_NO_TIMEOUT is used.

This method blocks the calling thread until either a new connection is successfully accepted or an error occurs.

set_domain ( DOMAIN )

Sets the domain name of the host we connect to (or actually what the CN in the servers certificate says). This is used in handshaking and if not matching handshake will fail.

set_socket_option ( OPTION, VALUE )
get_socket_option ( OPTION ) : VALUE

Gets and sets socket options. The following options are valid:

KeepAlive ( 1 | 0 )

Periodically test whether connection is still alive.

NoDelay ( 1 | 0 )

Disable Nagle algorithm. Don't delay send to coalesce packets.

Blocking ( 1 | 0 )

Do blocking or non-blocking (network) I/O.

close ( )

Closes the socket.

import_into_ssl_layer ( )

Imports the socket into NSS SSL layer if not already done. The constructor new does this automatically for you.

set_pkcs11_pin_arg ( ARG )

Sets the argument that is passed along to pkcs11 callbacks for the given socket. ARG can be any Perl scalar.

peer_certificate ( ) : Crypt::NSS::Certificate

Returns the certificate recived from the remote end of the connection. If we're a client that means we get the servers certificate and if we're the server we get the clients authentication certificate (if used).

keysize () : INTEGER

Returns the length (in bits) of the key used in the session.

secret_keysize ( ) : INTEGER

Returns the length (in bits) of the secret part in the key used in the session. Also known as effective key size.

issuer ( ) : STRING

Returns the distinguished name of issuer for the certificate on the other side. Returns no certificate if no certificate is used.

cipher ( ) : STRING

Returns the name of the cipher used in the session.

subject ( ) : STRING

Returns the distinguished name of the certificate on the other side.

pending ( ) : INTEGER

Returns the number of bytes of data available for read.

peerhost ( ) : STRING

Returns the host of the remote side.

Returns the port on the remote side.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 197:

Unknown directive: =ite