0

To receive the output of one of the processor which I use from Document AI I followed the below mentioned link https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/documentai/snippets/process_document_specialized_sample.py

when I run the above mentioned code on shell I'm getting the error mentioned below

E0313 19:32:21.672264000 8728953088 ssl_transport_security.cc:1501]    Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
E0313 19:32:21.672264000 8728953088 ssl_transport_security.cc:1501]    Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
E0313 19:32:21.672264000 8728953088 ssl_transport_security.cc:1501]    Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.

i debugged the process_document in code at some point it's failing at

        response = rpc(
            request,
            retry=retry,
            timeout=timeout,
            metadata=metadata,
        )

Thanks in advance

I've also set up my service account and added my key json to my environment variable.

1 Answers1

0

This is an issue with authentication/connectivity to Google Cloud APIs through the Python Client Library.

A custom root certificate might need to be used if you are behind a firewall or proxy and using Python client libraries to make Google API requests.

Python client libraries use gRPC underneath. Customers wanting to use a custom root certificate should set the following environment variable in a .env file located in the application's root directory:

GRPC_DEFAULT_SSL_ROOTS_FILE_PATH = "<path to .crt file>"

If you're running this code on an enterprise-managed machine, you might need to contact your system administrator for information on a custom Certificate Authority root certificate.

Holt Skinner
  • 1,692
  • 1
  • 8
  • 21