opaque-systems / opaquegateway-python

A privacy layer around LLMs
https://opaquegateway.readthedocs.io/en/latest/
30 stars 1 forks source link

SSL Error #41

Open Coding-Crashkurse opened 1 year ago

Coding-Crashkurse commented 1 year ago

Hello! After getting my API key I tried to run the very basic example from the Documentation:

Code:

from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv())

from opaqueprompts import sanitize, SanitizeResponse, desanitize

input_text_with_pii = "John Smith called 213-456-7098 (the phone number of his friend Sarah Jane) and asked her to meet him in San Francisco."
sanitized_response = sanitize(input_texts = [input_text_with_pii])

SSLError: _HTTPAConnectionPool(host='api.opaqueprompts.opaque.co', port=443): Max retries exceeded with url: /sanitize (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', '', 'certificate verify failed')])")))

Can you help me to identify the issue?

zizhong commented 1 year ago

@Coding-Crashkurse I tried on a brand new setup, but cannot reproduce it. Could you retry it to see if it works?

ggroode commented 1 year ago

Similarly just to ensure we are checking the same version you are using, can you share the output of pip list with us?

Coding-Crashkurse commented 1 year ago

opaqueprompts 0.0.6.

I use the latest version. I tried it again, but does not work. Here is my whole venv output:

Package            Version
------------------ ---------
aiohttp            3.8.5
aiosignal          1.3.1
annotated-types    0.5.0
asttokens          2.4.0
async-timeout      4.0.3
attrs              23.1.0
backcall           0.2.0
certifi            2023.7.22
cffi               1.15.1
charset-normalizer 3.2.0
colorama           0.4.6
comm               0.1.4
cryptography       41.0.3
dataclasses-json   0.5.14
debugpy            1.8.0
decorator          5.1.1
executing          1.2.0
frozenlist         1.4.0
greenlet           2.0.2
idna               3.4
ipykernel          6.25.2
ipython            8.15.0
jedi               0.19.0
jupyter_client     8.3.1
jupyter_core       5.3.1
langchain          0.0.287
langsmith          0.0.36
marshmallow        3.20.1
matplotlib-inline  0.1.6
multidict          6.0.4
mypy-extensions    1.0.0
nest-asyncio       1.5.7
numexpr            2.8.6
numpy              1.25.2
opaqueprompts      0.0.6
openai             0.28.0
packaging          23.1
parso              0.8.3
pickleshare        0.7.5
pip                22.3
platformdirs       3.10.0
prompt-toolkit     3.0.39
psutil             5.9.5
pure-eval          0.2.2
pyatls             0.0.3
pycparser          2.21
pydantic           2.3.0
pydantic_core      2.6.3
Pygments           2.16.1
PyJWT              2.8.0
pyOpenSSL          23.2.0
python-dateutil    2.8.2
python-dotenv      1.0.0
pywin32            306
PyYAML             6.0.1
pyzmq              25.1.1
requests           2.31.0
setuptools         65.5.0
six                1.16.0
SQLAlchemy         2.0.20
stack-data         0.6.2
tenacity           8.2.3
tornado            6.3.3
tqdm               4.66.1
traitlets          5.9.0
typing_extensions  4.7.1
typing-inspect     0.9.0
urllib3            2.0.4
wcwidth            0.2.6
yarl               1.9.2
chester-leung commented 1 year ago

@Coding-Crashkurse what OS and Python version are you using? The packages in the venv seem to be fine.

Can you try creating a completely fresh virtual environment, with only opaqueprompts==0.0.6 and python-dotenv installed, and see if that works? This is my output of pip list in a completely fresh environment.

Package            Version
------------------ ---------
certifi            2023.7.22
cffi               1.16.0
charset-normalizer 3.3.0
cryptography       41.0.4
idna               3.4
opaqueprompts      0.0.6
pip                23.0.1
pyatls             0.0.3
pycparser          2.21
PyJWT              2.8.0
pyOpenSSL          23.2.0
python-dotenv      1.0.0
requests           2.31.0
setuptools         56.0.0
urllib3            2.0.6
zizhong commented 1 year ago

@Coding-Crashkurse We have tested with different OpenSSL version as well. Found the atls implementation works well with openssl 3.0.2 and 3.1.3 but not 3.1.2. Could you help to share the result of openssl version? Thanks!