Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to AppWrite endpoint does not verify HTTPS certificate #11

Closed
cellerich opened this issue Jul 24, 2020 · 5 comments
Closed

Call to AppWrite endpoint does not verify HTTPS certificate #11

cellerich opened this issue Jul 24, 2020 · 5 comments

Comments

@cellerich
Copy link

Just noticed while using the AppWrite Phyton module in a Jupyter Notebook that I get a warning:

InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

I guess would be easy to fix with this statement before urllib3 is used:

import certifi
import urllib3
http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED',ca_certs=certifi.where())
@eldadfux
Copy link
Member

@cellerich please share the Appwrite SDK code you are using.

@cellerich
Copy link
Author

Setup:

  • I run my own copy of AppWrite in a Kubernetes cluster
  • trying stuff from within a Jupyter Notebook (Python) on how to access the database
  • appwrite version in Python is: appwrite==0.0.5

Code:

from appwrite.client import Client 
from appwrite.services.storage import Storage

client = Client()

client.set_project('5f1a86f2bfe96') # my project ID 
client.set_key('xxxxxxxxxxxxxxxxxxx') # my secret API key )
client.set_endpoint('https://aw.example.com/v1')  # my appwrite endpoint

storage = Storage(client)
filelist = storage.list_files()

Error message I get from Jupyter

C:\Users\msp\AppData\Local\Continuum\anaconda3\lib\site-packages\urllib3\connectionpool.py:847: InsecureRequestWarning:
Unverified HTTPS request is being made. Adding certificate verification is strongly advised. 
See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)

@eldadfux
Copy link
Member

@cellerich, you can try and use client. set_self_signed() method to allow your Appwrite SDK to send requests with a self-signed SSL certificate.

If you're running Appwrite on a server with a public IP and a public suffix domain, Appwrite will auto-generate an SSL certificate for you. Just make sure your domain is set properly in your Appwrite container ENV vars, and restart your Appwrite container to generate your certificate.

@cellerich
Copy link
Author

@eldadfux, that did the trick!

Thanks a lot for your work on AppWrite. I haven't done much yet, but I love it so far.
I know about the auto-generated SSL but in my case I'm running AppWrite in a small Kubernetes cluster together with NodeRed and OpenFaas and gave the "certificate handling" to my reverse proxy Traefik v2.

Again, thank you!

@eldadfux
Copy link
Member

That's great to hear @cellerich. If you'll have some time during the weekend, I'd love to hear your feedback about our upcoming built-in cloud functions for Appwrite, and learn if that might be useful for your use case instead of using Appwrite in combination with OpenFaas.

You can learn more about Appwrite cloud function on this links:
appwrite/appwrite#307
https://github.com/appwrite/appwrite/blob/master/docs/specs/functions.drawio.svg

I can share more info on our Discord channel: https://appwrite.io/discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants