We are testing with Firebase Authentication, and we're checking out python SDK. Attempting a simple get user operation from our Firebase users results in the following error:
TransportError: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",))
We tested from local server then from a staging GAE URL, as our initial thoughts were that maybe communicating with Firebase requires that the request comes from an Https URL. But, in both cases, we saw the same error. It's probably something else then.
Code used extract:
import firebase_admin
from firebase_admin import auth
from firebase_admin import credentials
cred = credentials.Certificate("custom/conf/conf.json")
default_app = firebase_admin.initialize_app(cred)
user_uid = '901234753'
user = auth.get_user(user_uid)
print 'Successfully fetched user data: {0}'.format(user.uid)
Any clue what may have caused this error and how to resolve it?
Update 1:
Adding SSL in app.yaml as suggested by @Mihail Russu in his comment
- name: ssl
version: latest
generated a new error: ImportError: cannot import name RAND_egd
in line:
from _ssl import RAND_add, RAND_egd, RAND_status, SSL_ERROR_ZERO_RETURN, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE,,SSL_ERROR_INVALID_ERROR_CODE
As per the page "ImportError: cannot import name RAND_egd " and the page "Fix RAND_egd import error in SDK..." I edited socket.py located at /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine (on Mac) to match their suggestions:
from _ssl import \
RAND_add, \
RAND_status, \
SSL_ERROR_ZERO_RETURN, \
SSL_ERROR_WANT_READ, \
SSL_ERROR_WANT_WRITE, \
SSL_ERROR_WANT_X509_LOOKUP, \
SSL_ERROR_SYSCALL, \
SSL_ERROR_SSL, \
SSL_ERROR_WANT_CONNECT, \
SSL_ERROR_EOF, \
SSL_ERROR_INVALID_ERROR_CODE
try:
from _ssl import RAND_egd
except ImportError:
# LibreSSL does not provide RAND_egd
pass
Update 1 result:
New errors generated:
-> local dev server: ('Connection aborted.', error(13, 'Permission denied'))
-> GAE: ('Connection broken: IncompleteRead(100 bytes read)', IncompleteRead(100 bytes read))
Anyone had a successful implementation of Firebase Auth with GAE? This feels a bit like going down the rabbit hole, thought using the SDK would be as easy as the javascript version of firebase auth..