ssl - Certificate unknown while making a request with hackney even when passing insecure option -


i attempting make call api developing using hackney.

this api rails app, develpment using nginx , passenger serve it, , generated ca certificate , host certificate using etcd_ca. i've installed ca certificate in linux box , neither curl, chrome or firefox complaint certificate.

but when attempt make request hackney error:

hackney:request(method, uri, headers, body, [insecure]).   18:43:15.720 [error] ssl: :certify: ssl_handshake.erl:415:fatal error: certificate unknown  ** (matcherror) no match of right hand side value: {:error, {:tls_alert, 'certificate unknown'}}     (omnitutor_rt) lib/omnitutor_rt/api_client.ex:49: omnitutorrt.apiclient.request/3     (omnitutor_rt) lib/omnitutor_rt/api_client.ex:7: omnitutorrt.apiclient.get_session/2 

in staging , development have valid certificate.

i running arch linux, elixir 1.2 , erlang 18.

erlang/otp 18 [erts-7.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]  linux 4.4.1-2-arch #1 smp preempt wed feb 3 13:12:33 utc 2016 x86_64 gnu/linux 

etcd-ca uses templates generate certificates:

https://github.com/coreos/etcd-ca/blob/master/documentation/certificate_template.md

could related? http://bugs.erlang.org/browse/erl-33

looking @ error, have file name , line number:

ssl_handshake.erl:415:fatal error: certificate unknown 

and reading source see happens when error caught, either ssl_certificate:trusted_cert_and_path or public_key:pkix_path_validation. unfortunately, don't see actual error information.

the best way figure out what's going wrong trace 2 functions. you'd type in erlang shell; elixir version should similar:

%% start tracer dbg:tracer(). %% trace function _c_alls _all_ processes dbg:p(all,c). %% add _t_race _p_attern relevant functions, %% , e_x_ceptions dbg:tp(ssl_certificate, trusted_cert_and_path, x). dbg:tp(public_key, pkix_path_validation, x). 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -