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.pemanddevice-cert.pemare signed by the generated CA certificate. ThecommonNameofserver-cert.confis 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 address192.168.3.30. - Copying
device-private.keyanddevice-cert.pemto the device which runsmender-client. - Configuring
ServerURL,TenantTokenandHttpsClientof/etc/mender/mender.confin 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/hostsin the device:192.168.3.30 my-tls.com - Now run
ping my-tls.comon the device → No packet loss. So the device can now accessmy-tls.com - Run
sudo systemctl restart mender-client.serviceon the device. And checking the log byjournalctl -u mender-client -fI 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
ServerURLinmender.cnftohttps://hosted.mender.io→ The device is shown aspending devicein hosted mender server.
My question is:
Which step is wrong?
Thanks a lot for reading the problem and answering my question!