szabgab has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to supply the public key instead of receiving it from the server after some hand shaking?$socket = IO::Socket::SSL->new ( PeerAddr => $ip, PeerPort => $port, Proto => 'tcp', SSL_version => 'SSLv3', SSL_use_cert => 1, SSL_key_file => 'client-key.pem', SSL_cert_file => 'client-cert.pem', );
Where the $cert_file is the selfsigned certificate. The only minor issue I faced after this is to get the cert file of the server I was actually talking to (and not that of the desktop of the developer...) but this is really only a minor issue.my $socket = IO::Socket::SSL->new ( PeerAddr => $ip, PeerPort => $port, SSL_ca_file => $cert_file, Proto => 'tcp', SSL_version => 'SSLv3', SSL_verify_mode => 1, ); print $socket ? "OK\n" : "FAILED\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using SSL with fixed public key
by idsfa (Vicar) on Apr 30, 2006 at 15:47 UTC |