[erlang-questions] ssl certificate verification in httpc

Robert Raschke rtrlists@REDACTED
Tue Jul 15 13:18:43 CEST 2014


Hi Ivan,

are you sure you need to verify the certificate? If SSL is only used for
encryption, then a simple request will do the trick, that is, just leave
out the ssl option.

I've never verified a cert, so if you do need that, hopefully someone else
can be of assistance.

Regards,
Robby



On 15 July 2014 11:58, Ivan Uemlianin <ivan@REDACTED> wrote:

> Dear All
>
> I am using httpc to access a web server over https.  From reading the
> erlang ssl docs, this looks like the right way to do it:
>
>     Url = "https://bla.org/bla",
>     SSLOpts = [{verify, verify_peer},
>                {cacertfile,"certificates.crt"}],
>     httpc:request(get, {Url, []}, [{ssl,SSLOpts}], []).
>
> But this returns an unknown ca error:
>
>     {error,{failed_connect,[{to_address,{"bla.org", 443}},
>                             {inet,[inet],{tls_alert,"unknown ca"}}]}}
>     11:06:04.942 [error] SSL: certify: ssl_handshake.erl:1344:Fatal error:
> unknown ca
>
> The certificates file is in pem format, and I can't see from the docs page
> what ssl options I might add.  Is there somewhere else I need to add a
> reference to the CA?
>
> In short, what am I missing to be able to verify this certificate?
>
> With thanks and best wishes
>
> Ivan
>
>
> --
> ============================================================
> Ivan A. Uemlianin PhD
> Llaisdy
> Speech Technology Research and Development
>
>                     ivan@REDACTED
>                      www.llaisdy.com
>                          llaisdy.wordpress.com
>               github.com/llaisdy
>                      www.linkedin.com/in/ivanuemlianin
>
>                         festina lente
> ============================================================
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140715/c1c25bef/attachment.htm>


More information about the erlang-questions mailing list