thousandsofthem
Please help me debug the issue with https certificates, need some ideas what to check next
When fetching data using http clients, some https:// urls returning “Certificate Expired”, despite being perfectly valid, e.g. https://investing.com/, https://api.amplitude.com/ .
It looks like it doesn’t depend on erlang version, elixir version, http library version.
Base system is (a) OSX 10.14.5 (b) Docker, Alpine Linux
test app #1
elixir 1.9.4
erlang 22.3.4.1 (also 22.1.8)
mojito 0.6.4
mint 1.1.0
httpoison 1.5.0
hackney 1.15.2 (also 1.16.0)
iex(8)> Mojito.request(:get, "https://api.amplitude.com/")
[info] TLS :client: In state :certify at ssl_handshake.erl:1764 generated CLIENT ALERT: Fatal - Certificate Expired
{:error,
%Mojito.Error{
message: nil,
reason: %Mint.TransportError{
reason: {:tls_alert,
{:certificate_expired,
'TLS client: In state certify at ssl_handshake.erl:1764 generated CLIENT ALERT: Fatal - Certificate Expired\n'}}
}
}}
iex(9)> HTTPoison.get("https://api.amplitude.com/")
[info] TLS :client: In state :certify at ssl_handshake.erl:1764 generated CLIENT ALERT: Fatal - Certificate Expired
{:error,
%HTTPoison.Error{
id: nil,
reason: {:tls_alert,
{:certificate_expired,
'TLS client: In state certify at ssl_handshake.erl:1764 generated CLIENT ALERT: Fatal - Certificate Expired\n'}}
}}
iex(10)> opts = [ssl: [cacertfile: :certifi.cacertfile(), verify: :verify_peer]]
iex(11)> HTTPoison.get("https://api.amplitude.com/", [], opts)
# same error - CLIENT ALERT: Fatal - Certificate Expired
test app #2
elixir 1.3.4
erlang 19.3.6.5
hackney 1.15.0
httpoison 1.0.0
iex(6)> HTTPoison.get("https://api.amplitude.com/")
[error] SSL: :certify: ssl_handshake.erl:1609:Fatal error: certificate expired
{:error, %HTTPoison.Error{id: nil, reason: {:tls_alert, 'certificate expired'}}}
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
According to
curlthe certificate has expired for at leasthttps://api.amplitude.com/. There was an issue over the weekend with an expired root certificate fromComodo/Sectigo CAforhttps://openexchangerates.orgas well. Perhaps these sites are using the same certificate chain. Have you checked their support site?thousandsofthem
There are high chance your guess is correct.
Though on my system curl, firefox, chrome all think there are no issues (both OSX and Ubuntu)
Thanks!
kip
That interesting - my
curloutput is fromMacOS.kip
Using
https://www.sslshopper.com/ssl-checker.html#hostname=https://api.amplitude.com/has the details and its indeed the Comodo and AdTrust certificates that have expired on May 30, 2020.At this point I assume some clients are correctly validating the certificate chain and some are not.
thousandsofthem
Ubuntu 20.04 - no issues
Ubuntu 18.04 - no issues
Ubuntu 16.04 - server certificate verification failed
Also, tried providing fresh
cacert.pemfrom curl - Extract CA Certs from Mozilla to httption/hackney - no changes in behavior, same errorthousandsofthem
It is unknown how good/actual sslshopper is.
Check my SSL Certificate | Is your SSL certificate valid and installed ? says there are no issues
Check SSL Certificate - GeoCerts says all good
etc
kip
Totally fair and I’m definitely not a domain expert. I’m just going on the expiration dates on the certificates. So yes, I’m assuming they are correctly decoding the certificate metadata - and perhaps I shouldn’t.
This is where one usually invokes @voltone as the eventual source of truth
kip
I ran the check on
https://ssllabs.comwhich I think is well respected. It shows the intermediate and root certificates sent by the server as expired.However, it also shows that there are three paths to establishing trust, one that includes the expired certificates and two that do not. As I understand it from some reading, the
:sslapp is unable to resolve alternative trust paths and therefore will fail to validate the peer in more situations than other clients. (I know that is not precise, mostly because I only understand a very small amount of this topic).It also suggests why you are seeing different outcomes from different clients.
thousandsofthem
This basically means the root of the issue is how
:ssloperates and therefore it should affect a lot of people, not just me. Also, it’s surprising given this thing exists for a dozen (or two) years alreadykip
Well to be fair, the server’s certificate chain is invalid and should be fixed.
And in addition,
:ssldefinitely has limitations and is a salutary example of why rolling your own is something I imagine the Erlang developers would probably avoid if they got to do it over againActually Im being imprecise again. The function to verify peer is something a user provides - perhaps there is an enhanced validation function already out there in the cosmos.