Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks! Awesome group. I put out a simple question in the access/vba forum that I couldn't find answered on technet or anywhere else on the web and it was answered the same day!!..."

Geography

Where in the world do Tek-Tips members come from?

Perl client side authe using certicate

perlnewbie9292 (Programmer)
15 May 12 10:11
Hello all,

I'm having trouble getting the following code to work and at a point where I am stuck. I am trying to perform client side authentication using a certificate during a POST request. I'm only interested in sending the client cert to the server and don't really need to check the server certificate.

Here is the cUrl command that trying to replicate:
curl --cacert caCertificate.pem --cert clientCerticate.pem https://xx.xx.xx.xx:8443

I keep getting the following error in my Perl script:
ssl handshake failure

I guess I have two questions: what should I be pointing to for CRT7 AND KEY8 variables? and is this the best way to send a POST request using client cert authentication?

CODE

#!/usr/bin/perl use warnings; use strict; use Net::SSLeay qw(post_https); my $$hostIp = "xx.xx.xx.xx" my $hostPort = "8443" my $postCommand = ""; my $http_method = 'plain/text'; my $path_to_crt7 = 'pathToCert.pem'; #using clientCerticate.pem is this correct? my $path_to_key8 = 'pathToKey.pem'; #using clientCerticateKey.pem is this correct? my ($page, $response, %reply_headers) = post_https($hostIp, $hostPort, $postCommand, '', $http_method, $path_to_crt7, $path_to_key8 ); print $page . "\n"; print $response . "\n";

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close