Ir al contenido
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Inicia sesión
  • Nederlands English (US) Español (AR)
  • Contáctanos
  • Inicio
  • Blog
  • Empleos
  • Contáctanos
Cafayate.Net
  • 0
  • 0
    • Inicio
    • Blog
    • Empleos
    • Contáctanos
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Inicia sesión
  • Contáctanos

Python requests SSL and InsecurePlatformWarning

  • Todos los blogs
  • Tech Blog
  • Python requests SSL and InsecurePlatformWarning
  • 5 de marzo de 2021 por
    Administrator

    Every now and then, when using Python 2.7 < 2.7.9 and trying to access SSL resources, especially through the requests toolkit, which seems to trigger the issue frequently – but I’ve seen it on some combinations of pip inside virtualenv as well – you’ll get an error or a warning along those lines:

    InsecurePlatformWarning: A true SSLContext object is not  
    available. This prevents urllib3 from configuring SSL appropriately and  
    may cause certain SSL connections to fail. For more information, see  
    https://urllib3.readthedocs.org/en/latest  
    /security.html#insecureplatformwarning.
    

    or

    SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.  
      SNIMissingWarning
    

    or, even worse:

    error: SSLError: hostname 'xxx.franzoni.eu' doesn't match either of www.franzoni.eu, franzoni.eu  
    

    This is caused by old libraries in python < 2.7.9 and < 3.4. To fix that, just add to your current virtualenv those three packages:

    pip install pyOpenSSL ndg-httpsclient pyasn1  
    

    You may need runtime/development packages for python and openssl as well in order for the build to succeed, e.g. python-dev libssl-dev libffi-dev on Ubuntu 14.04.

     

     

     

    apt-get install python3-dev python3-setuptools
    en Tech Blog
    Ubuntu UFW LXC

    Diseñado para empresas

    Somos un equipo de personas apasionadas cuyo objetivo es mejorar la vida de todos a través de productos revolucionarios. Creamos grandes productos para resolver sus problemas empresariales. Nuestros productos están diseñados para pequeñas y medianas empresas dispuestas a optimizar su rendimiento.

    Contáctenos

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

    • +31 653-919-302
    • [email protected]
    Síganos
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)