Comments (6)
Thank you for bringing up this discussion in such a detailed way. This is probably best handled by @ifedapoolarewaju, the developer behind tus-py-client. However, it might take a few days until he's able to respond.
from tus-py-client.
Ok, many thanks :)
from tus-py-client.
Hi any thoughts / feedback regarding this issue?
from tus-py-client.
hi @dcs3spp do you know what URL is being requested from tuspy client at the time the error is thrown? I am asking to know what library throws the error of the two used by the client
from tus-py-client.
Firstly, if both environment variables are set it works great. A great library that has made development much easier.
The URL endpoint that I am passing to tus-py-client is the tus endpoint https://test.example.com:1081/files/. I only receive an upload URL from tus-py-client if the REQUESTS_CA_BUNDLE environment variable is set. This allows the requests library to successfully send a request for creating an upload url, e.g. https://test.example.com:1081/files/640fd39f3325f301273576e12b3e335c+e22beb02-18fe-4b8e-a57f-39de91ec9fcb
If the SSL_CERT_FILE environment is not also set then a chunk fails to upload with an SSL VERIFY Exception from the http.client library.
Moving forward is there the possibility to raise a new feature request allowing the path to the CA certificate to be specified in TusClient constructor which then gets passed onto the requests and http-client libraries?
I have tried to include a detailed account below. Hope this helps.
Kind regards
dcs3spp
The tusd server is running behind an nginx proxy with an SSL terminated connection. I can visit the /files/ and /metrics/ endpoints for tusd successfully in browsers with a SSL/TLS connection successfully.
I am making a request to tus-py-client as follows:
try:
........<earlier code to to set path to file to upload and initialise meta data>
uploader = tusd_client.uploader(filepath, chunk_size=6291456, metadata=meta_data_dict)
uploader.upload()
log.info("test_upload_document_template :: sent upload request to tusd server")
except TusCommunicationError as ce:
raise RuntimeError(f"tusclient error {ce}") from ce
If I do not set REQUESTS_CA_BUNDLE environment variable then tus-py-client throws an exception when using the requests library. The exception is an SSLError and is triggered at line 205 of uploader.py in the create_url function :
SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),))
If I set REQUESTS_CA_BUNDLE but do not set SSL_CERT_FILE then the following occurs.
- A url is created for uploaded by the create_url function in uploader.py. This is
https://test.example.com:1081/files/640fd39f3325f301273576e12b3e335c+e22beb02-18fe-4b8e-a57f-39de91ec9fcb
- tus-py-client creates a TusRequest instance and starts the process of uploading file chunks. When the first chunk is uploaded an exception is thrown at line 287 of the _do_request function in uploader.py. This is triggered from line 276 in the upload_chunk function. The exception that is rasied is [SSL: CERTIFICATE_VERIFY_FAILED]. Upon further inspection of the source code, TusRequest uses the http.client library
If I then set REQUESTS_CA_BUNDLE and SSL_CERT_FILE everything works.
from tus-py-client.
Closing this issue due to inactivity. Feel free to leave a comment if you want to continue the discussion :)
from tus-py-client.
Related Issues (20)
- metadata encoding adjustable HOT 5
- Support Termination extension
- complex json metadata encoding support HOT 2
- Release of a new version HOT 3
- Cryptic stacktrace when trying to start upload HOT 2
- Client does not work with tusd v2 HOT 2
- Fix failing CI tests HOT 2
- Upload-Metadata not working HOT 3
- Make setup.py work with Dependabot
- file_stream bug HOT 3
- Release A new version to pip? HOT 6
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte HOT 2
- Provide a requests session to Uploader [Feature Request] HOT 3
- upload_chunk() no longer works in 1.0.1 HOT 3
- Multiple file uploads HOT 1
- Client Certificate HOT 5
- Custom error handler HOT 1
- Typing information is not exposed (PEP 561) HOT 1
- Python client resumability question. HOT 2
- Use Python to upload without saving locally? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tus-py-client.