GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gcloud-python can't import OpenSSL in App Engine (since it can't be vendored in) · Issue #1445 · googleapis/google-cloud-python

gcloud-python can't import OpenSSL in App Engine (since it can't be vendored in) #1445

New issue
Copy link
New issue
Copy link
Closed
Closed
gcloud-python can't import OpenSSL in App Engine (since it can't be vendored in)#1445
Copy link
Labels
authpackaging

Description

@ghost
ghost
opened on Feb 11, 2016

I noticed the depending crypto module was changed since commit 948cccf. The project was deployed with GAE release 1.9.32 and gcloud-python 0.9.0.

Here are some context info according to your recent comments:

  1. How do you vendor in gcloud-python for App Engine?
    As described in GAE documentation: https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring

  2. Which services / gcloud-python subpackages do you use? (I'm curious which imports / import paths your code has been using.)
    I am generating signed url for an object in Google Cloud Storage. Here's the partial stacktrace:

    Traceback (most recent call last):
    ---- omitted for simple trace) ----
    from ext import cloudstorage as storage
    File "/base/data/home/apps/sjackend-0/1.390622100755930629/ext/cloudstorage.py", line 8, in
    from gcloud import (
    File "/base/data/home/apps/s
    jackend-0/1.390622100755930629/lib/gcloud/storage/init.py", line 43, in
    from gcloud.storage.blob import Blob
    File "/base/data/home/apps/sjackend-0/1.390622100755930629/lib/gcloud/storage/blob.py", line 28, in
    from gcloud.credentials import generate_signed_url
    File "/base/data/home/apps/s
    jackend-0/1.390622100755930629/lib/gcloud/credentials.py", line 22, in
    from OpenSSL import crypto
    File "/base/data/home/apps/sjackend-0/1.390622100755930629/lib/OpenSSL/init.py", line 8, in
    from OpenSSL import rand, crypto, SSL
    File "/base/data/home/apps/s
    jackend-0/1.390622100755930629/lib/OpenSSL/rand.py", line 11, in
    from OpenSSL._util import (
    File "/base/data/home/apps/sjackend-0/1.390622100755930629/lib/OpenSSL/_util.py", line 6, in
    from cryptography.hazmat.bindings.openssl.binding import Binding
    File "/base/data/home/apps/s
    jackend-0/1.390622100755930629/lib/cryptography/hazmat/bindings/openssl/binding.py", line 14, in
    from cryptography.hazmat.bindings._openssl import ffi, lib
    ImportError: dynamic module does not define init function (init_openssl)

I guess this is caused by the inherent inflexibility with runtime environment in GAE, and affects #1009 which seems to conflict with this issue.

Activity

  1. dhermes
    added
    packaging
    auth
    on Feb 11, 2016
  2. dhermes
    closed this as completedon Feb 11, 2016
  3. dhermes commented on Feb 11, 2016

    @dhermes
    dhermes
    on Feb 11, 2016
    Contributor
    More actions

    Moving this back in to #1436

  4. dhermes commented on Feb 11, 2016

    @dhermes
    dhermes
    on Feb 11, 2016
    Contributor
    More actions

    Re-opening, this is a different import error than the one in #1436, will rename accordingly

  5. dhermes
    reopened this on Feb 11, 2016
  6. dhermes
    changed the title [-]gcloud-python 0.9.0 SSL broken in app engine[/-] [+]gcloud-python can't import OpenSSL in App Engine (since it can't be vendored in)[/+] on Feb 11, 2016
  7. dhermes commented on Feb 11, 2016

    @dhermes
    dhermes
    on Feb 11, 2016
    Contributor
    More actions

    @savvykang-bnnjack Thanks for filing. For now, you can get around this by editing gcloud/credentials.py

    diff --git a/gcloud/credentials.py b/gcloud/credentials.py
    index 9874042..ab5151c 100644
    --- a/gcloud/credentials.py
    +++ b/gcloud/credentials.py
    @@ -19,7 +19,10 @@ import datetime
     import six
     from six.moves.urllib.parse import urlencode  # pylint: disable=F0401
    
    -from OpenSSL import crypto
    +try:
    +    from OpenSSL import crypto
    +except ImportError:
    +    crypto = None
    
     from oauth2client import client
     from oauth2client.client import _get_application_default_credential_from_file

    and then your code should work just fine using google.appengine.api.app_identity.sign_blob.

  8. dhermes
    added 3 commits that reference this issue on Feb 11, 2016

    Allowing pyOpenSSL import to fail for GAE.

    This issue will close once commit 6d85ae0 is merged into the 'master' branch.
    6d85ae0

    Allowing pyOpenSSL import to fail for GAE.

    This issue will close once commit e56ecf4 is merged into the 'master' branch.
    e56ecf4

    Allowing pyOpenSSL import to fail for GAE.

    This issue will close once commit 7921ebc is merged into the 'master' branch.
    7921ebc
  9. dhermes
    closed this as completedin #1446on Feb 12, 2016
  10. parthea
    added a commit that references this issue on Nov 26, 2025

    fix: Guard delete statements. Add default fallback for _use_non_block…

    91f75b2
  11. parthea
    added a commit that references this issue on Mar 9, 2026

    fix: allow Protobuf 6.x (#1445)

    3537f64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authpackaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.