Net::SSLeay Variables Net::SSLeay for Perl

221

9.1.1 Net::SSLeay Variables

Net::SSLeay exports several global variables that are useful for controlling the behavior of the modules. Some of them are useful only for debugging your programs, but most of them provide finer control over the behavior of OpenSSL itself or some of the utility functions that are provided by the module. linux_debug This variable should be set only when the module is being used on a Linux system. If it is set to a nonzero value, process information from procpidstat will be displayed for each read and write. trace This variable sets the trace level that is used by the high-level utility functions. It is intended primarily for debugging, so it should generally be set to zero in production programs the zero guarantees silence. Valid values for this variable are 0 for silence, 1 for only errors to be reported, 2 for cipher information to be reported, 3 to report progress, and 4 to display everything, including the data that is both sent and received. slowly This variable is used with the sslcat utility function. It controls the number of seconds that sslcat will sleep after sending data and before closing the sending side of the connection. It defaults to zero, which means that sslcat will not sleep at all, but some servers may require a delay; otherwise, they wont be able to read all of the data that was sent. ssl_version This variable sets the version of the SSL protocol that is used by the high-level utility functions. By default, it is set to 0, which indicates that the version should be guessed as SSLv2, SSLv3, or TLSv1. Valid values for this variable are 2 for SSLv2, 3 for SSLv3, 10 for TLSv1, and 0 to guess SSLv2, SSLv3, or TLSv1. random_device This variable contains the name of a file that will be used to seed OpenSSLs PRNG. The default setting for this variable is devurandom, but not all operating systems have such a device. If your system does not have such a device, you should consider using a third- party program that can provide entropy, such as EGADS. You can optionally use devrandom if your system has it; however, that device can block if not enough randomness is available. See Chapter 4 for a discussion on the importance of properly seeding the PRNG. how_random This variable specifies, in bits, how much entropy should be collected from the source specified by random_device . The default value is 512 bits. If you change this, be sure that you collect enough entropy, but also be careful that you do not collect too much, especially if youre using devrandom as your entropy source, because it could block until more becomes available. 222

9.1.2 Net::SSLeay Error Handling