Giter Site home page Giter Site logo

Comments (5)

noxxi avatar noxxi commented on July 30, 2024

The example server only requests a certificate from the client if option --ca is set because only then the certificate can be verified. And if no certificate is requested the client will not send one. I've updated the code to make this more clear in the usage description.

from p5-io-socket-ssl.

Logioniz avatar Logioniz commented on July 30, 2024

Thanks, with --ca option works.

Can't understand how to get client certificate without verify and not specify client CA. It is possible?
So if i have my own self signed certificate which i want to check on server side. What i must to do?

from p5-io-socket-ssl.

noxxi avatar noxxi commented on July 30, 2024

Can't understand how to get client certificate without verify and not specify client CA. It is possible?

As documented the certificate is requested if SSL_verify_mode is set to SSL_VERIFY_PEER. But the way the example programs works is that SSL_VERIFY_PEER is only used if option --ca is given. This is just an example program and not a full featured test server.

from p5-io-socket-ssl.

Logioniz avatar Logioniz commented on July 30, 2024

Oh, my question is not relevant for this example.

For example i have server with SSL_verify_mode option. How can i do client request with self signed certificate?

#!/usr/bin/perl
use Mojo::Base -strict;

use IO::Socket::SSL;
use DDP;

my $server = IO::Socket::SSL->new(
    # where to listen
    LocalAddr => '127.0.0.1',
    LocalPort => 3000,
    Listen => 10,

    # which certificate to offer
    # with SNI support there can be different certificates per hostname
    SSL_cert_file => 'tls/cert.pem',
    SSL_key_file => 'tls/key.pem',
    SSL_verify_mode => SSL_VERIFY_PEER
) or die "failed to listen: $!";

# accept client
my $client = $server->accept or die
    "failed to accept or ssl handshake: $!,$SSL_ERROR";

warn p $client->peer_certificates;

In this example i get certificate verify failed, because certificate is self signed.

from p5-io-socket-ssl.

Logioniz avatar Logioniz commented on July 30, 2024

Oh, very thanks. Found answer in your documentation. Need to set SSL_verify_callback option to validate.

from p5-io-socket-ssl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.