-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Azure IoT Identity service (aziotctl)]: Device certificate request CSR is not being validated when using EST-Server (libest) #483
Comments
Did you modify the dockerfile with the correct hostname for the VM? ## If you want to host your EST server in the cloud (for example, an Azure Container Instance),
## change myestserver.westus.azurecontainer.io to the fully qualified DNS name of your EST server
## and uncomment the next line.
# RUN sed -i "s|ip6-localhost|myestserver.westus.azurecontainer.io |g" ./ext.cnf
Are you saying that with the same libest container, it works when it's on the same VM as IoT Edge, but gives error when it's remote?
This line is from identity service? |
Thanks @jlian for the quick reply!
Yes, I have done that. For other questions, let me explained what I have tried so far.I have tried following cases: case 1: I installed and configured EST-Server(libest without docker) and aziotctl directly (without dockerizing anything) on the target device (linux machine). So the device I have run only libest and azure iot idententity service. Everything works as expected, I mean provisioning using x509 and DPS works. case 2: I installed and configured aziotctl on the target device (linux) and libest as docker container running on another machine in the same network as the target device. I am able to connect and interact with the est-server, But the provisioning using x509 and DPS is not working. It seems that azure iot identity service is not able to get a valid certificate from libest. case 3: I installed and configured aziotctl on the target device (directly without docker) and libest directly on an azure vm (without dockerizing it). I am able to connect and interact with the est-server, BUT provisioning using x509 and DPS is not working. It seems that azure iot identity service is not able to get a valid certificate from libest. For case 2 and 3, I investigated more. I could observe on the log console of est-server that each time aziotctl is requesting with csr at est-server, the est-server is logging following:
That means that est-server is not validating the certificate request coming from azure iot identity service. I hope I could answer all your questions. Thanks in advance! |
Our tutorial was adapted from Kevin's blog https://kevinsaye.wordpress.com/2021/05/19/enabling-enrollment-over-secure-transport-est-for-azure-iot-edge-1-2/ Did you say when you followed @ksaye blog, it works? With the libest container in ACI? |
@MZDN I am a little confused also. |
Hi all, @ksaye Issue that azure iot identity service is not getting device certificates from est-server (libest) when this server is called from remotely. I have tried with Azure iot identity service azioctl 1.4.0 and 1.4.1. I have written above in my 1st comment that est-server (libest) is returning correctly the device certificates that the dps needs, when I tried the code you have published in https://kevinsaye.wordpress.com/2021/08/09/interfacing-with-est-enrollment-over-secure-transport-with-c/ , |
@MZDN I have never used the Identity Service and EST without IoT Edge. I am not sure what portions of the DPS + x509 come from the Identity Service and what comes from Edge, nor what the product group has tested. |
@MZDN without IoT Edge things might be a bit different, have you tried https://azure.github.io/iot-identity-service/using-est-with-certd.html |
Thanks for your reply @jlian!
I applied the config above with following command: sudo aziotctl config apply I checked logs: Est-server log side: Everytime when aziotctl requests est-sever, I can see the following on the console:
On the device side: when I am logging with sudo aziotctl system logs -- -f, I could see following:
|
Might have to dial in @arsing to take a look |
Hi @jlian, |
This seems like a certificate configuration issue rather than something wrong with IIS; the hostname verification should pass. You can inspect the resolved certificate with
|
Hi all, following have been tried:
I am seeing the following log at the EST-SERVER:
Any idea what could be the error on the 2nd one? |
Subject CN doesn't matter because CNs can't be IP addresses. What is needed is a SAN IP entry for |
openssl s_client -showcerts -connect EST_SERVER_IP:443
|
You've cut out the PEM blob that I asked for. |
@MZDN, this command from dockerfile in the tutorial: RUN sed -i "s|ip6-localhost|myestserver.westus.azurecontainer.io |g" ./ext.cnf Uses However, since you're using IP address you might want to actually open up the https://github.com/cisco/libest/blob/main/example/server/ext.cnf Here, you'd replace And I guess you can just do it in the dockerfile by changing the aforementioned line to: RUN sed -i "s|127.0.0.1|<YOUR VM IP ADDRESS>|g" ./ext.cnf @arsing keep me honest also |
here it is:
|
Thanks @jlian. |
Okay, running that through
Is 20.229.120.186 the |
Yes! |
Try using |
server side: no log, when aziotctl hits
client side:
|
@arsing any ideas? |
@MZDN what about @arsing can you help here? Does the error |
Hello @jlian, That request is hitting the endpoint. In this issue, I have the feeling that the request that is constructed by aziotctl can't be validated at libest-server when aziotctl and libest-server are not the same network. |
I already added a comment about this issue at Azure/iotedge#6579 (comment). I was asked to open an issue. I think it fits more here on this project.
Infrastructure:
Configurations:
Issue:
when aziotctl requests device certificate by sending CSR, remote est-server (libest) is not validating that request
OSSL error: 139832112584448:error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:../ssl/record/rec_layer_s3.c:1543:SSL alert number 42
Additional note:
Please note that aziotctl and est-server (libest) work fine when both were running on the same vm.
Est-server is also working fine when I am interfacing with est-server (remote) with the example written by Kevin Saye in his blog: https://kevinsaye.wordpress.com/2021/08/09/interfacing-with-est-enrollment-over-secure-transport-with-c/
The text was updated successfully, but these errors were encountered: