As being inexperienced Perl and SSL, I'm attempting to write code for the following scenario: As a 'remote site' I need to connect to "secure port" 2601 on the 'XEP'. The XEP will negotiate a secure SSL/TLS connection the remote connecting site. The remote site will need to accept the XEP's certificate. Then the XEP will prompt for a username and password If the remote site responds with the correct username and password, the connection is allowed. The non ssl works, Any hints appreciated
code segments: use 5.008006; use strict; use warnings; use Carp; use IO::Socket::INET; use IO::Socket::SSL; use Data::Dumper; use POSIX qw(ceil floor); use HTTP::Headers::ActionPack::Authorization::Basic; sub connect { my $self = shift; my $sock; if ( $self->{use_ssl} ) { warn "creating SSL socket to $$self{host}:$$self{port}" if ( $self->{debug} ); # use HTTP::Headers::ActionPack::Authorization::Basic; # create from parameters $sock = HTTP::Headers::ActionPack::Authorization::Basic->new( 'Basic' => { username => 'myuser, password => 'mypassword' } ) } else { $sock = new IO::Socket::INET( PeerAddr => $self->{host}, PeerPort => $self->{port}, Proto => 'tcp' ); }
In reply to Connecting to SSL socket with user/password by cyberdot49
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |