[erlang-questions] ssl certificate verification in httpc

Ivan Uemlianin ivan@REDACTED
Tue Jul 15 12:58:09 CEST 2014


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
============================================================



More information about the erlang-questions mailing list