Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cro::HTTP::Client: Server certificate verification failed: self signed certificate in certificate chain #77

Open
wbiker opened this issue Jun 5, 2019 · 3 comments

Comments

@wbiker
Copy link

wbiker commented Jun 5, 2019

I want to use the cro client to fetch a rss xml from a server which uses a self signed certificate. Its in our work network so I do not care about man-in-the-middle attach and so on.
The error

comes from IO::Socket::Async::SSL module and according to its docu I have to give the insecure => True parameter. But I did not find a way to give that to cro::HTTP::Client.
Client.new(secure => False) did not what I want.

I did not think it is a bug. But the docu did not help with that issue.
Thanks for helping!
Wolfgang

@abraxxa
Copy link
Contributor

abraxxa commented Dec 3, 2019

I have a similar issue which I can't work around on because there seems no way to set IO::Socket::Async::SSL parameters.

Died because of the exception:
    Tried to get the result of a broken Promise
      in block  at /home/ahartmai/.perl6/sources/ECCB15BAEF09CE282370A569F7B29849407D48B5 (Cro::HTTP::Client) line 604

    Original exception:
        Tried to get the result of a broken Promise
          in block  at /home/ahartmai/.perl6/sources/0609EA0BB03C70C2C15DB4B144D7041C1059D14C (Cro::TLS) line 108

        Original exception:
            An operation first awaited:
              in block  at /home/ahartmai/.perl6/sources/A4ECA701FE96A8456AEB83692D6B3C55AAFC964C (IO::Socket::Async::SSL) line 322

            Died with the exception:
                Certificate contains no altnames to check host against
                  in block  at /home/ahartmai/.perl6/sources/A4ECA701FE96A8456AEB83692D6B3C55AAFC964C (IO::Socket::Async::SSL) line 322

@abraxxa
Copy link
Contributor

abraxxa commented Dec 3, 2019

I just found a workaround as the ca parameter is in fact passed to Cro::TLS unmodified:

my $client = Cro::HTTP::Client.new:
    ca => {
        insecure => True
    };

@demanuel
Copy link

demanuel commented Mar 6, 2021

for using with the get call:

Cro::HTTP::Client.get($url, ca=> { :insecure })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants