FAQ
hi folks
hi guru of perl

in the examples of Net::SSLeay, it shows various examples that use low-level
functions use Socket. what are the differences if we re writing the examples
with IO::Socket::SSL

all testimonials are welcome

--
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x092164A7
gpg --keyserver pgp.mit.edu --recv-key 092164A7

Search Discussions

  • Uri Guttman at Aug 3, 2011 at 12:12 am
    "mfe" == ml@smtp fakessh eu writes:
    mfe> in the examples of Net::SSLeay, it shows various examples that
    mfe> use low-level functions use Socket. what are the differences if
    mfe> we re writing the examples with IO::Socket::SSL


    just use IO::Socket::SSL. then all the code is almost the same as when
    using IO::Socket. the only differences are adding in the cert info and
    minor other differences. there is plenty of stuff on how to code with
    plain sockets which also usually works well with IO::Socket. using low
    level Socket.pm calls is almost never needed and is clunky. a simple
    connect is just:

    my $sock = IO::Socket::INET->new( 'host:port' ) ;

    with the Socket.pm api you would need a whole section of code for
    that. if you need more, the key/value api is easy to use and it easily
    modified to be IO::Socket::SSL.

    uri

    --
    Uri Guttman -- uri AT perlhunter DOT com --- http://www.perlhunter.com --
    ------------ Perl Developer Recruiting and Placement Services -------------
    ----- Perl Code Review, Architecture, Development, Training, Support -------
  • Ml at Aug 3, 2011 at 1:27 am

    Le mercredi 3 août 2011 02:12, Uri Guttman a écrit :
    "mfe" == ml@smtp fakessh eu <ml@smtp.fakessh.eu> writes:
    mfe> in the examples of Net::SSLeay, it shows various examples that
    mfe> use low-level functions use Socket. what are the differences if
    mfe> we re writing the examples with IO::Socket::SSL


    just use IO::Socket::SSL. then all the code is almost the same as when
    using IO::Socket. the only differences are adding in the cert info and
    minor other differences. there is plenty of stuff on how to code with
    plain sockets which also usually works well with IO::Socket. using low
    level Socket.pm calls is almost never needed and is clunky. a simple
    connect is just:

    my $sock = IO::Socket::INET->new( 'host:port' ) ;

    with the Socket.pm api you would need a whole section of code for
    that. if you need more, the key/value api is easy to use and it easily
    modified to be IO::Socket::SSL.

    uri

    I'm not much can be in perl Fu. but I can not run this example
    that are present in the bundle IO::Socket::SSL

    the server starts well but the client not starts well
    The only changes I have made on the certificate and the key
    key file and cert file are well present in the folder
    # eg modification for exemple

    if(!($sock = IO::Socket::SSL->new( PeerAddr => 'localhost',
    PeerPort => '8000',
    Proto => 'tcp',
    SSL_use_cert => 1,
    SSL_verify_mode => 0x01,
    SSL_key_file => 'key.txt',
    SSL_cert_file => 'cert.txt',
    SSL_passwd_cb => sub { return "" },
    )))

    I get the following error after starting the client
    ~]$ perl Desktop/IO-Socket-SSL-1.44/example/ssl_client.pl
    unable to create socket: IO::Socket::INET6 configuration
    failederror:00000000:lib(0):func(0):reason(0)

    all testimonials are welcome


    --
    http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x092164A7
    gpg --keyserver pgp.mit.edu --recv-key 092164A7

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedAug 3, '11 at 12:05a
activeAug 3, '11 at 1:27a
posts3
users2
websiteperl.org

2 users in discussion

Ml: 2 posts Uri Guttman: 1 post

People

Translate

site design / logo © 2021 Grokbase