Net::SSLeay Low-Level Bindings

225 This function writes the data specified by data to the SSL connection specified by ssl . The function will not return until all of the data has been written. The data to be written may be passed as a reference. The return from this function will be the number of bytes that were written. If you call the function requesting an array return, the first element of the array will be the number of bytes written, and the second element will be the string representation of any errors that occurred. ssl_write_CRLFssl, data This function is a simple wrapper around ssl_write_all that makes an additional call to ssl_write_all to write both a carriage return and a linefeed after your data. The return from this function is the total number of bytes written. Remember that this byte count will include the carriage return and linefeed characters.

9.1.4 Net::SSLeay Low-Level Bindings

The Net::SSLeay module does not provide bindings for all of the functions that OpenSSL exports as part of its public API; however, it does provide a sizable subset of them. Certainly, the most commonly used functions have bindings, and the author has added bindings for a random splattering of other functions as needed. We dont provide a complete list of all of the bindings that are supported. There is a complete list contained in the Net::SSLeay package. If there is a function that is missing, you should consider adding it yourself or contacting the author of Net::SSLeay. In general, the Perl bindings for OpenSSL match the C functions for which they provide bindings. That is, both the arguments and the return values are the same. As you would expect, there are some differences. The most significant difference is that the names of the Perl bindings are not prefixed with SSL_ as the OpenSSL C functions are. Instead, you should prefix the names with Net::SSLeay:: to get the function or constant that you want. If the function name does not start with SSL_ in the OpenSSL C library, the name is the same in Perl. There are two notable exceptions to the rule that Perl bindings take the same arguments as OpenSSL C functions. Both read and write as exported by Net::SSLeay provide bindings to SSL_read and SSL_write ; however, the Perl bindings are more intelligent about the data types that are passed through them. For example, write automatically figures out the number of bytes that need to be written. For the most part, callbacks are not implemented in Net::SSLeay. Only one callback is implemented, and it does not come without a potentially severe restriction. The one callback that is implemented is the verify callback, which is used for verifying certificates. The restriction is that there can be only one callback across all SSL contexts, sessions, and connections. For most client applications, this restriction will probably never be encountered, but for server applications, the potential severity of the restriction increases significantly. One final point to consider is that Net::SSLeay is not thread-aware. Given that threading is still experimental in Perl, its not so surprising that Net::SSLeay isnt thread-aware. As Perl moves closer to fully supporting threading, this will become more of an issue, but for now it is something to keep in the back of your mind while designing and implementing your SSL-enabled applications in Perl using Net::SSLeay.

9.2 M2Crypto for Python