SSL: certificate verify failed: certificate has expired

Hi

I am facing repeated errors due to some issues with SSL certificate. This happens typically in the middle of sequence during run of farmware loop plants with filters.

what can be done about it?

thanks

martin

1 Like

I’ve also had a few of these

Selfie & Loop plants with filters both fail for me often with the errors below.

[Loop-Plants-With-Filters : run] HTTPSConnectionPool(host=‘my.farm.bot’, port=443): Max retries exceeded with url: /api/points/135708 (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1051)’)))

Is the API unavailable sometimes?

Which certificate is failing?

cc @roryaronson

[Loop-Plants-With-Filters : run] HTTPSConnectionPool(host=‘my.farm.bot’, port=443): Max retries exceeded with url: /api/points/135764 (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1051)’)))

The certificate error is actually a misleading one. It means that the NTP time is off. SSL certificates have a good before and after time built in, and when NTP is disconnected, time will skew enough to make SSL certificates appear invalidated

1 Like

So it’s basically just a network problem I guess.

@connor please do you think this one is also a network issue?

Token Refresh failed: {{:badmatch, {:error, {:shutdown, {:failed_to_start_child, Farmbot.BotState.Transport.HTTP, {{:badmatch, {:error, :socket_closed_remotely}}, [{Farmbot.BotState.Transport.HTTP, :init, 1, [file: ‘lib/farmbot/bot_state/transport/http/http.ex’, line: 56]}, {GenStage, :init, 1, [file: ‘lib/gen_stage.ex’, line: 1644]}, {:gen_server, :init_it, 2, [file: ‘gen_server.erl’, line: 374]}, {:gen_server, :init_it, 6, [file: ‘gen_server.erl’, line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: ‘proc_lib.erl’, line: 249]}]}}}}}, [{Farmbot.Bootstrap.AuthTask, :restart_transports, 0, [file: ‘lib/farmbot/bootstrap/auth_task.ex’, line: 80]}, {Farmbot.Bootstrap.AuthTask, :do_refresh, 0, [file: ‘lib/farmbot/bootstrap/auth_task.ex’, line: 47]}, {:gen_server, :try_dispatch, 4, [file: ‘gen_server.erl’, line: 637]}, {:gen_server, :handle_msg, 6, [file: ‘gen_server.erl’, line: 711]}, {:proc_lib, :wake_up, 3, [file: ‘proc_lib.erl’, line: 259]}]}

That also looks like a network problem to me. socket_closed_remotely is probably some timeout on the receiving end due to a TCP connection taking too long to connect.

I have now connected farmbot via ethernet cable. I cannot tell the difference yet, since I am not using loop plants with filters right now.

Sometimes in logs, there is duration of http requests appearing. Via wifi, these entries were around ~8seconds. After connecting to ethernet, they tend to show ~5seconds in the logs. Hope it will help with issues with farmware in future as well…