Mender-cli fails to login on EU region

an error prevents to connect to Hosted Mender in EU region through cli.
When running mender-cli login --server, after insering username (the email) and password, pops the following error:

FAILURE: POST /auth/login request failed: Post "": x509: certificate has expired or is not yet valid: current time 2023-10-08T17:45:34+02:00 is after 2023-10-08T13:12:41Z

Does anyone knows what could be the problem here?

I would recommend to use a token. Logging in is the old way to perform actions.

From the Mender Dashboard go to account settings and create a PAT (GENERATE A TOKEN). Use this token to perform various tasks. You also can store this token in a save file and fetch it on demand.

Example with --token-value:

# Copy file from a device to your local machine
mender-cli --server $URL --token-value $PAT cp $MENDER_DEVICE_ID:$REMOTE_PATH $LOCAL_PATH

# Upload artifact
mender-cli artifacts upload ./my_artifacts/system-update-0.0.1.mender \
        --server $URL \
        --token-value $PAT \

There was an issue with the certificate on today which has been resolved. Is the problem still existing @BlueEcoLine?


Is there a way to store this token somewere? I’ve made a script to handle it but then the autocompletion doesn’t work anymore.

Yes today the same login command works perfectly, it was just an unlucky day.

Hi @BlueEcoLine,

The long-lived PAT can be generated and managed in the “my profile” section of the Mender dashboard settings.


Yes thanks, but I mean if is there some configuration file where mender-cli can store it on my system.

Hi @BlueEcoLine,

Unfortunately I don’t think that there is a path to do that in mender-cli yet. I’ll take it to the dev team, it is a good idea to improve the value of the tool, thank you!