Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Add system tests for service account credentials#51

Merged
theacodes merged 2 commits intomasterfrom
service-account-system-tests
Oct 25, 2016
Merged

Add system tests for service account credentials#51
theacodes merged 2 commits intomasterfrom
service-account-system-tests

Conversation

@theacodes
Copy link
Copy Markdown
Contributor

@theacodes theacodes commented Oct 25, 2016

Resolves #42

@theacodes theacodes added this to the 1.0.0 milestone Oct 25, 2016
@theacodes
Copy link
Copy Markdown
Contributor Author

Hrm. No idea why the certificate verification is failing. I'm gonna poke around and see what's up.


def verify_environment():
"""Checks to make sure that requisite data files are available."""
if not os.path.exists(DATA_DIR):

This comment was marked as spam.

This comment was marked as spam.

assert info['email'] == credentials._service_account_email
assert info['scope'] == (
'https://www.googleapis.com/auth/userinfo.email '
'https://www.googleapis.com/auth/userinfo.profile')

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Copy Markdown
Contributor Author

Holy old OpenSSL version, batman!

OpenSSL 1.0.1 14 Mar 2012

@theacodes
Copy link
Copy Markdown
Contributor Author

@dhermes I'm not sure what to do here other than disable HTTPS for the system tests. :(

@dhermes
Copy link
Copy Markdown
Contributor

dhermes commented Oct 25, 2016

@jonparrott We've never had issues with HTTPS on Travis.

@theacodes
Copy link
Copy Markdown
Contributor Author

@dhermes using httplib2? mild shock

httplib2 doesn't do SNI verification at all. Urllib3 is choking because google uses SNI extensively and since the openssl version is too low to include SNI support, it prefers to raise an SSL error instead of just continuing the request.

@theacodes
Copy link
Copy Markdown
Contributor Author

theacodes commented Oct 25, 2016

Some research:

With our Python runtime (debian8) using both certifi.where() and OS certs work with SNI. (This is what we do by default in _make_default_http)

With Travis (Ubuntu 12.04 LTS) using certifi.old_where() works but generates an InsecurePlatformWarning. Using OS certs works but generates an SNIMissingWarning. Using OS certs with PyOpenSSL works without warnings.

@dhermes
Copy link
Copy Markdown
Contributor

dhermes commented Oct 25, 2016

Ha, should've guessed it.

@dhermes
Copy link
Copy Markdown
Contributor

dhermes commented Oct 25, 2016

LGTM (in light of #52)

@theacodes theacodes merged commit 447c5be into master Oct 25, 2016
@theacodes theacodes deleted the service-account-system-tests branch October 25, 2016 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants