File: tcpip2ssl.t

package info (click to toggle)
libxml-stream-perl 1.24-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 952 kB
  • sloc: perl: 4,821; xml: 64; makefile: 4
file content (49 lines) | stat: -rw-r--r-- 1,588 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use strict;
use warnings;

use Test::More tests=>5;

SKIP:
{
    eval("use IO::Socket::SSL 0.81;");
    skip "IO::Socket::SSL not installed", 4 if $@;
    skip "No network communication allowed", 4 if ($ENV{NO_NETWORK});

    BEGIN{ use_ok( "XML::Stream","Tree", "Node" ); }

    my $stream = XML::Stream->new(
        style=>'node',
        debug=>'stdout',
        debuglevel=>0,
    );
    ok( defined($stream), "new()" );

    SKIP:
    {

        my $status = $stream->Connect(hostname=>"jabber.org",
                                      port=>5223,
                                      namespace=>"jabber:client",
                                      connectiontype=>"tcpip",
                                      ssl=>1,
                                      ssl_verify=>0x00,
                                      timeout=>10);
        is( $stream->{SIDS}->{newconnection}->{ssl_params}->{SSL_verifycn_name},
            'jabber.org', 'SSL_verifycn_name set' );

        skip "Cannot create initial socket", 2 unless $stream;
        
        ok( $stream, "converted" );

        $stream->Connect(hostname=>"jabber.org",
                         to=>'example.com',
                         port=>5223,
                         namespace=>"jabber:client",
                         connectiontype=>"tcpip",
                         ssl=>1,
                         ssl_verify=>0x00,
                         timeout=>10);
        is( $stream->{SIDS}->{newconnection}->{ssl_params}->{SSL_verifycn_name},
            'example.com', 'SSL_verifycn_name set to "to" value' );
    }
}