http://www.perlmonks.org?node_id=1049464


in reply to Re: Use Net::SSLeay, how to read the encrypted ssl alert record.
in thread Use Net::SSLeay, how to read the encrypted ssl alert record.

Have you?   :-/   The documentation that you refer-to here is frankly almost nonexistent:   the SSL_alert_ functions listed here show you how to extract bits of information from the alert record, but give no clue as to how one goes about getting one.

It’s pretty obvious that this library is a “wrapper” for functionality described, more-or-just-barely, at http://www.openssl.org/, which also does not readily dish-up the answer.   So, if anyone here actually knows the answer, and can offer a snippet of working Perl code, I am sure that it would be well received in the spirit of what PerlMonks should be.

Replies are listed 'Best First'.
Re^3: Use Net::SSLeay, how to read the encrypted ssl alert record.
by vsespb (Chaplain) on Aug 14, 2013 at 19:29 UTC
    The code
    print Net::SSLeay::alert_desc_string(0);
    simply returns 'CN' (close notify).
    Did OP tried that? Did he have some problem with this function? Did he mention it in original post? No.
Re^3: Use Net::SSLeay, how to read the encrypted ssl alert record.
by fwingx (Novice) on Aug 15, 2013 at 01:49 UTC

    I have checked all the DESCRIPTION of Net::SSLeay, even check the code of the IO::Socket::SSL, that module used the Net::SSLeay to make ssl connection. But I can not find any help.

    The only clue is about set_info_callback function in Net::SSLeay. But the description is disillusionary:

    "Sets the callback function, that can be used to obtain state information for $ssl during connection setup and use. When callback is 0 (NULL), the callback setting currently valid for ctx is used. ??? (does this function really work?)"

    Net::SSLeay::set_info_callback($ssl, $cb); # $ssl - value corresponding to openssl's SSL structure # $cb - pointer to function ??? # # returns: no return value

    And I have a try, it seem that function can not work well in perl.