Net::SSLeay with Socket or IO::Socket::SSL

Net::SSLeay with Socket or IO::Socket::SSL

am 03.08.2011 01:58:53 von ML

--nextPart11722546.tys0faM3bO
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

hi folks
hi guru of perl

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

all testimonials are welcome

=2D-=20
=A0http://pgp.mit.edu:11371/pks/lookup?op=3Dget&search=3D0x0 92164A7
=A0gpg --keyserver pgp.mit.edu --recv-key 092164A7

--nextPart11722546.tys0faM3bO
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBOOI9EtXI/OwkhZKcRApU2AJ4/ZY16HnsgSOF+aWSplIefioYQ5gCd FSrZ
ivc5gIknrCeYoMbiFtiSSYs=
=nUf0
-----END PGP SIGNATURE-----

--nextPart11722546.tys0faM3bO--

Re: Net::SSLeay with Socket or IO::Socket::SSL

am 03.08.2011 02:12:02 von Uri Guttman

>>>>> "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 -------

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Net::SSLeay with Socket or IO::Socket::SSL

am 03.08.2011 03:21:48 von ML

--nextPart2275792.t5OpBVhO3h
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Le mercredi 3 ao=FBt 2011 02:12, Uri Guttman a =E9crit=A0:
> >>>>> "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 =3D 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 =3D IO::Socket::SSL->new( PeerAddr =3D> 'localhost',
PeerPort =3D> '8000',
Proto =3D> 'tcp',
SSL_use_cert =3D> 1,
SSL_verify_mode =3D> 0x01,
SSL_key_file =3D> 'key.txt',
SSL_cert_file =3D> 'cert.txt',
SSL_passwd_cb =3D> 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=20
failederror:00000000:lib(0):func(0):reason(0)

all testimonials are welcome


=2D-=20
=A0http://pgp.mit.edu:11371/pks/lookup?op=3Dget&search=3D0x0 92164A7
=A0gpg --keyserver pgp.mit.edu --recv-key 092164A7

--nextPart2275792.t5OpBVhO3h
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBOOKKytXI/OwkhZKcRAombAJ40rCuMohC/aVgMFXQlqLOmXQMHSQCf Rni/
CMq7vVDq1TBQ1zl7gHsr3jU=
=XErG
-----END PGP SIGNATURE-----

--nextPart2275792.t5OpBVhO3h--