Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
TLS/SSL exceptions from Pythonista 2.1
-
@omz I am getting the following exceptions from Dropbox scripts running on Pythonista 2.1. They were running without error yesterday on Pythonista 2.0. I am using an iPad with iOS 9.3.2.
Is anyone else seeing this?
/var/containers/Bundle/Application/0A6E6890-4845-449B-9931-B5845AF8878F/Pythonista.app/Frameworks/PythonistaKit.framework/pylib/site-packages/urllib3/util/ssl_.py:318: 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
/var/containers/Bundle/Application/0A6E6890-4845-449B-9931-B5845AF8878F/Pythonista.app/Frameworks/PythonistaKit.framework/pylib/site-packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarningIronically it says to use a newer version of Python, but that is what has raised these exceptions.
Here is the minimal stripped-down code that will reproduce this.
# coding: utf-8 from dropbox import client, session APP_KEY = 'aaaaaaaaaaaaaaa' APP_SECRET = 'bbbbbbbbbbbbbbb' ACCESS_TYPE = 'dropbox' ACCESS_KEY = 'cccccccccccccccc' ACCESS_SECRET = 'ddddddddddddddd' sess = session.DropboxSession(APP_KEY, APP_SECRET, ACCESS_TYPE) sess.set_token(ACCESS_KEY, ACCESS_SECRET) client = client.DropboxClient(sess) folder_metadata = client.metadata('/')
Any ideas, anyone?
-
dropbox.dropbox.requests.packages.urllib3.disable_warnings()
-
I am sure the ultimate answer is to get things upgraded to Dropbox API v2 but wanted to report this just in case.
@ccc Disable warnings -- that, too.
-
Pythonista is based on CPython 2.7.5 but the current CPython is 2.7.11. It you go back and read the URLs that you provided above, you will see that urllib3 warns you if you are doing certain things with CPython versions prior to 2.7.9.
-
@ccc said:
Pythonista is based on CPython 2.7.5 but the current CPython is 2.7.11. It you go back and read the URLs that you provided above, you will see that urllib3 warns you if you are doing certain things with CPython versions prior to 2.7.9.
Thank you for the version numbers -- that explains a lot. I reported this since these exceptions were not popping up in Pythonista 2.0 but started with 2.1. I'm upgrading code to Dropbox v2, but will just disable these warnings in the current v1 code.