question

Upvotes
Accepted

Error "certificate verify failed" Python

Hola,

Tengo un error al intentar obtener datos de volatilidades, estoy lanzando un proceso en python llamado "ETIVolatilitySurface.py", he cambiado los datos de conexión (usuario, password e ID de aplicación) pero siempre me sale el siguiente error:


SSLError: HTTPSConnectionPool(host='api.refinitiv.com', port=433): Max retries exceeded with url: /auth/oauth2/v1/token (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_cerificate', 'certificate verify failed')]">>>


También me pasa al intentar lanzar el ejemplo que hay en el QuickStart Guide for Refinitiv Data Platform.


Estoy detrás de un proxy que tiene la entidad para la que trabajo, pero en principio y por lo que han comprobado tengo acceso a todas las url's que necesito. En este caso concreto el proceso hace llamadas a 'api.refinitiv.com'.


¿Podríais ayudarme?

Muchas gracias.

elektron-sdkrdp-apirefinitiv-data-platformerrorsslcertificate
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @axel.zamorano.empresa_externa

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

@axel.zamorano.empresa_externa

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hello @axel.zamorano.empresa_externa

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Upvote
Accepted
22k 58 14 21

¿Puede explicar cómo está configurando el proxy en su aplicación?
El atributo "verify=False" debe usarse en cada llamada de Requests.

response = requests.post(..., verify=False)
response = requests.get(..., verify=False)

Cada módulo de Python tiene su propia forma de configurar el certificado. Para Requests, use la variable de entorno:

set REQUESTS_CA_BUNDLE=path_to_proxy_certificate.pem
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
22k 58 14 21

Hola @axel.zamorano.empresa_externa,

Parece que su proxy está interceptando y volviendo a firmar las solicitudes SSL. Tendrá que importar el certificado de su proxy en el "almacén de certificados de confianza" para el lenguaje de programación que está utilizando.

Si usa Python, puede deshabilitar la verificación de certificados pasando la opción "verify=False" al módulo de Solicitudes de Python. Esto es solo para probarlo y no es el enfoque recomendado. Definitivamente no lo hagas en el entorno de producción.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hola, muchas gracias por la respuesta.


He probado el segundo paso que me has dicho (verify=False) y sigue apareciendo el mismo error.

Respecto al primero, no entiendo muy bien donde debería poner el certificado que comentas, ¿podrías desarrollarlo un poco más?


Muchas gracias.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Muchas gracias Gurpreet,

Poniendo el verify=False en las request ya me desaparece el error, pero ahora me aparece uno que es "Acceso Denegado" "Lo sentimos, este acceso está restringido". Puede ser tema de credenciales pero lo he revisado y si no me equivoco tengo los correctos.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
22k 58 14 21

Ok, me alegro de que se hayan solucionado los problemas de conexión / proxy.


Le recomendaría que siga la guía de inicio rápido para crear una AppKey y probar sus credenciales, o ponerse en contacto con su administrador de cuenta Refinitiv.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.