Unable to run IoT Edge Module in Visualstudio : [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

Manoharan, Kesavaraj 5 Reputation points
2023-01-13T12:57:13.6433333+00:00

I try to create a edge module, my linux machine edge gateway is success and device is online in IoTHub. I am using this device connection string to create a custom IoT Edge module with simulator from visualstudio, when i run the solution it always throws the SSL error.

Note : earlier it was working fine, recently getting this error due to some policy changes.

could any one help me on this.

ERROR: HTTPSConnectionPool(host='kredemo.azure-devices.net', port=443): Max retries exceeded with url: /devices/KREDemoEdge/modules/target?api-version=2020-05-31-preview (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))

[ERROR]: Failed to run 'iotedgehubdev modulecred -l -m "target"' with error: ERROR: HTTPSConnectionPool(host='kredemo.azure-devices.net', port=443): Max retries exceeded with url: /devices/KREDemoEdge/modules/target?api-version=2020-05-31-preview (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
576 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,198 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
222 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Manoharan, Kesavaraj 5 Reputation points
    2023-01-19T22:12:38.85+00:00

    Thanks finally the issue is fixed.

    our corporate firewall blocked this host *.azure-devices.net. After, unblock it works fine.

    1 person found this answer helpful.
    0 comments No comments

  2. QuantumCache 20,271 Reputation points
    2023-03-10T01:06:23.5133333+00:00

    Glad to hear that issue is resolved!

    Apart from the Firewall issue, we can review below few troubleshooting steps,

    If we think SSL certificates are causing the issue, It seems like there might be some changes in the certificate policies on the dev machine, due to which the certificate verification is failing.

    To resolve this issue, you can try the following steps:

    1. Check if your machine has the latest root certificates installed. You can check for updates using your operating system's package manager or by downloading the latest root certificate updates from the certificate provider's website.
    2. You can try disabling certificate verification for testing purposes by setting the verify_ssl parameter to False in your code.
    3. If you want to continue with certificate verification, you can add the root certificate of your IoT Hub to your machine's trusted root store. You can do this by downloading the root certificate from the Azure portal and importing it into your machine's trusted root store.
    4. If none of the above steps work, you can try updating the OpenSSL library on your machine or reinstalling it to ensure that it's up-to-date with the latest security policies.

    I hope this helps you to resolve the SSL certificate verification error in your IoT Edge module.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.