Signurl command requires the pyopenssl library in gsutil in google storage in creatiing signed URL
Asked Answered
L

8

6

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

Langrage answered 28/7, 2014 at 11:15 Comment(1)
When you run the Python interpreter, can you import OpenSSL ?Vd
Y
5

When using Python 3 and gsutil 5.27 or older, install pyopenssl as

pip3 install --user pyopenssl==23.2.0

The gsutil is trying to import load_pkcs12 from OpenSSL.crypto that was removed in the 23.3.0 version

Yim answered 3/2, 2024 at 9:3 Comment(1)
Worked for me on OS X.Fornax
D
4

Install with

pip3 install --user pyopenssl

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

Denna answered 26/5, 2020 at 6:40 Comment(0)
Y
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

Yolanda answered 16/6, 2021 at 23:33 Comment(0)
R
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

Ra answered 3/12, 2019 at 10:9 Comment(0)
T
1

A recent version of pyopenssl (2.23.3) seems to have broken gsutil: https://github.com/GoogleCloudPlatform/gsutil/issues/1753 If you encounter this, you may want to revert to an older version.

Torpedoman answered 15/12, 2023 at 14:58 Comment(0)
S
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

Springing answered 27/8, 2014 at 11:49 Comment(0)
C
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)

Clamworm answered 13/9, 2016 at 20:33 Comment(0)
S
-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

Significant answered 30/1, 2019 at 4:36 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.