Hi Everyone,
I am testing the mTLS feature with hosted mender. According to the section “Mutual TLS authentication” I did the following configurations:
- Generating
ca-private.key
,ca-cert.pem
,server-private.key
,server-cert.pem
,device-private.key
,device-cert.pem
, whereserver-cert.pem
anddevice-cert.pem
are signed by the generated CA certificate. ThecommonName
ofserver-cert.conf
is set as my-tls.com, which is used as the domain name of local hosted mTLS ambassador. - Starting the mTLS ambassador in a virtual machine. The ambasaddor connects to the hosted mender server successfully. Setting a bridge network adapter of the virtual machine, so that the mTLS ambassador can be accessed by an
ip address
. For example, now the device in the same network can access mTLS ambassador by theip address
192.168.3.30
. - Copying
device-private.key
anddevice-cert.pem
to the device which runsmender-client
. - Configuring
ServerURL
,TenantToken
andHttpsClient
of/etc/mender/mender.conf
in the device as:
Since the device needs to connect to mTLS ambassador, I added following line to{ "ServerURL": "https://my-tls.com", "TenantToken": "TENANT_TOKEN_FROM_HOSTED_MENDER", "HttpsClient": { "Certificate": "/home/pi/device-cert.pem", "Key": "/home/pi/device-private.pem" } }
/etc/hosts
in the device:192.168.3.30 my-tls.com
- Now run
ping my-tls.com
on the device → No packet loss. So the device can now accessmy-tls.com
- Run
sudo systemctl restart mender-client.service
on the device. And checking the log byjournalctl -u mender-client -f
I got the following error:raspberrypi mender[5425]: time="2022-11-16T20:01:31+01:00" level=error msg="Failure occurred while executing authorization request: Method: Post, URL: https://my-tls.com/api/devices/v1/authentication/auth_requests" raspberrypi mender[5425]: time="2022-11-16T20:01:31+01:00" level=error msg="Failed to authorize with \"https://my-tls.com\": Unknown url.Error type: Host validation error"
It seems that the mender-client
cannot access my-tls.com
. Then I did the following checks:
- Checking the log of ambassador in the virtual machine → no request info of the device. So the ambassador does not get the request from device.
- Changing the
ServerURL
inmender.cnf
tohttps://hosted.mender.io
→ The device is shown aspending device
in hosted mender server.
My question is:
Which step is wrong?
Thanks a lot for reading the problem and answering my question!