4

I am trying Create a signed URL with gsutil . following is the command $ gsutil signurl -d 10m path/to/privatekey.p12 gs://bucket/foo

mentioned in site https://developers.google.com/storage/docs/accesscontrol

I also issued a same like command with my bucket name and object as below

gsutil signurl -d 10m C:\Users\Desktop\javascript\service\4e263da.p12 gs://code-sample/File1

but i got following error

"signurl command requires the pyopenssl library try pip install pyopenssl or easy_install pyopenssl"

.So,i installed PyOpenSSL for window from here

https://pypi.python.org/pypi/pyOpenSSL/0.13 .My python version is 2.6.Still i am getting same error in running the command. So my question why command signurl is still not recognized after i installed pyopenssl in gsutil

abishkar bhattarai
  • 7,371
  • 8
  • 49
  • 66

6 Answers6

4

Install with

pip3 install --user pyopenssl

and it should works (especially if you're running in the cloud console)!

2

was getting this error and tried a variety of python pyopenssl options, but this worked for me in the end, on: Debian 10 with Google Cloud SDK 345.0.0 gsutil version: 4.63

sudo apt-get install python3-openssl

techhapps
  • 21
  • 1
1

I had the same problem with Python v3.7.5 and gsutil v4.46.

To fix the issue I installed pyopenssl for Python 2: pip2 install --user pyopenssl

pprishchepa
  • 997
  • 1
  • 9
  • 21
0

The issue might be because you are using 64 bit system and python Working with egenix-pyopenssl-0.13.4.1.0.1.9.win32-py2.7 - 32bit and python 32 bit solved this problem for me... Even google document recommends use of 32bits

Parag Bhayani
  • 3,280
  • 2
  • 28
  • 52
0

I'm running Python 2.7 with same issue. ProcMon was showing that the bundled Python was being executed (%LOCALAPPDATA%\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\python.exe) and not Python in the path variable.

I renamed the 'bundledpython' directory and re-ran 'gsutil signurl' and it ran successfully.

Note: this is after the crypto library was installed (https://cloud.google.com/sdk/crypto)

-1

The problem is rooted in the gsutil shell script and the python libraries. The gsutil script expects Python 2.

pip3 uninstall pyOpenSSL
pip2 install pyOpenSSL

After the above I could successfully sign URLs using gsutil

chb
  • 1,727
  • 7
  • 25
  • 47
bestbear
  • 71
  • 1
  • 2